/* join — paper, centred. The closing moment: a line you can join. */
#join { overflow: clip; padding-bottom: 0; }
#join .join-top { display: grid; justify-items: center; text-align: center; gap: clamp(28px, 3vw, 44px); }
#join .join-head { display: grid; justify-items: center; }
#join .join-h { margin-top: var(--s3); white-space: nowrap; font-size: clamp(76px, 15vw, 240px); line-height: .84; letter-spacing: -0.06em; }
#join .join-act { display: grid; gap: 14px; width: min(100%, 480px); }
#join .join-act .waitlist { max-width: none; }
#join .join-note { font-size: var(--t-small); color: var(--ink-70); }

@media (max-width: 720px) {
  #join .join-h { font-size: 19.5vw; }
  #join .join-note { padding-left: 0; text-align: center; }
}

#join .queue { margin-top: clamp(64px, 7vw, 104px); }

/* ---------- The ask: email and an optional invite code (sections/_waitlist-form.html) ----------
   Used by #join on every page and by the invite page. The invite code is a dashed pill above the
   email pill: a ticket stub, not a second form. A successful signup goes to joined.html. */
[data-wl] [hidden] { display: none !important; }
/* The confirmation page sets [hidden] on its share block (only a new place in line has a link) and
   on the native Share button (only where navigator.share exists); .fs-act and .btn would show them
   anyway. Patched in clearpath-website. */
#joined [hidden] { display: none !important; }
[data-wl] { --wl-err: #9B2C22; }
[data-wl] .wl-ask { display: grid; justify-items: center; gap: 14px; width: 100%; }
[data-wl] .join-note { font-size: var(--t-small); line-height: 1.5; color: var(--ink-70); }
[data-wl] .wl-skip { white-space: nowrap; }

[data-wl] .wl-code {
  display: flex; align-items: center; gap: 12px; width: 100%; height: 50px; padding: 0 6px 0 22px;
  border: 1.5px dashed var(--ink); border-radius: var(--r-pill); background: var(--paper-2);
}
[data-wl] .wl-code:focus-within { box-shadow: 0 0 0 4px rgba(36,64,158,.18); }
[data-wl] .wl-code-lab { flex: none; color: var(--ink-70); cursor: text; }
[data-wl] .wl-code input {
  flex: 1 1 auto; min-width: 0; height: 100%; padding: 0; border: 0; background: transparent; outline: none;
  font-family: var(--f-mono); font-size: 16px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink);
}
[data-wl] .wl-code input::placeholder { color: var(--ink-28); }
[data-wl] .wl-code-x { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 50%; background: none; color: var(--ink-70); cursor: pointer; }
[data-wl] .wl-code-x:hover { background: var(--paper); color: var(--ink); }
[data-wl] .wl-code-x svg { width: 18px; height: 18px; }
[data-wl] .wl-code.is-bad { border-color: var(--wl-err); }
[data-wl] .wl-code.is-open { animation: wl-in .35s var(--ease) both; }

[data-wl] .wl-err { font-size: var(--t-small); line-height: 1.45; color: var(--wl-err); }
.wl-skip, .fs-lk {
  padding: 0; border: 0; background: none; font: inherit; color: var(--ink); cursor: pointer;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: var(--ink-28);
}
.wl-skip:hover, .fs-lk:hover { text-decoration-color: var(--ink); }
[data-wl] .waitlist .btn[aria-busy="true"] { pointer-events: none; opacity: .7; }
@keyframes wl-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { [data-wl] .wl-code.is-open, .fs-top { animation: none !important; } }
@media (max-width: 420px) { [data-wl] .wl-code { padding-left: 18px; } }

/* ---------- Full-screen pages: joined.html (the confirmation) and invite.html (a friend's link) ----------
   One screen, no scroll: the words sit at the top, the queue art takes whatever height is left
   (js/join.js sets --art-h to it), and under ~600px tall the art goes so the words always fit. */
.fs { --hh: 73px; height: calc(100vh - var(--hh)); height: calc(100svh - var(--hh)); display: flex; flex-direction: column; overflow: clip; }
@media (max-width: 899.98px) { .fs { --hh: 65px; } }   /* the header plus its 1px rule */
.fs-top {
  flex: none; display: grid; justify-items: center; text-align: center;
  padding-top: clamp(24px, 7svh, 88px); padding-bottom: clamp(16px, 3svh, 32px);
  animation: wl-in .6s var(--ease) both;
}
.fs-top[hidden] { display: none; }
.fs-k { color: var(--ink-70); }
.fs-h { margin-top: clamp(8px, 1.4svh, 14px); font-size: min(clamp(56px, 9vw, 152px), 17svh); line-height: .88; letter-spacing: -0.055em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.fs-h.is-num { font-size: min(clamp(84px, 13vw, 200px), 20svh); }
.fs-say { margin-top: clamp(12px, 2.2svh, 22px); max-width: 38ch; font-size: var(--t-body); line-height: 1.5; color: var(--ink-70); text-wrap: balance; }
.fs-act { margin-top: clamp(16px, 3svh, 30px); width: min(100%, 480px); display: grid; justify-items: center; gap: 12px; }
.fs-act .waitlist { max-width: none; }
.fs-share input { font-weight: 500; color: var(--ink); text-overflow: ellipsis; }
.fs-share .btn { min-width: 128px; justify-content: center; }
.fs-native { gap: 10px; }
.fs-native svg { width: 16px; height: 16px; }
.fs-sent { margin-top: clamp(12px, 2svh, 20px); font-size: var(--t-small); color: var(--ink-70); }
.fs-sent b { font-weight: 600; color: var(--ink); }
.fs-art { flex: 1 1 auto; min-height: 0; position: relative; display: flex; align-items: flex-end; }
.fs-art .art-queue { width: 100%; margin-left: 0; }
@media (max-height: 600px) { .fs-art { display: none; } .fs { justify-content: center; } .fs-top { padding-block: 16px; } }
@media (max-width: 420px) {
  .fs-h { font-size: min(12.6vw, 14svh); }
  .fs-h.is-num { font-size: min(21vw, 15svh); }
  .fs-share .btn { width: 100%; }
}
/* already joined: no "Join the waitlist" in the header */
body:has(.fs) .nav-join, body:has(.fs) .nav-join-sm, body:has(.fs) .sheet-join { display: none; }

/* ---------- The waitlist illustration (art/queue.css) ---------- */
/* ==========================================================================
   Clear Money · waitlist illustration ("Get in line.")
   The co-op's own street in daylight: a line of neighbours on the sidewalk,
   past the duplex, the terrace and the apartments, heading for a green
   bungalow with its front door open. The empty cobalt spot at the back is
   yours; .is-in fills it.
   Drawn flat, in the co-op scene's camera and palette: solid fills, solid
   shade planes, no filters, gradients or blur. Generated by gen/queue.py,
   which also writes the layout block below (between the @gen markers).

   Sizing: full-bleed, clamp(280px, 30vw, 460px) tall. The SVG scales to the
   box height (200 scene units) and is centred on the section, so the street
   runs off both edges. A person is 28 units tall; a door is 34.
   Per layout: --z zooms the scene about the bottom centre, --sx shifts it,
   --you-x is your spot (scene units). The tag is HTML and follows the spot.
   State: .art-queue.is-in (or any ancestor with .is-in) shows you in line.
   ========================================================================== */

.art-queue {
  --art-h: clamp(280px, 30vw, 460px);
  --u: calc(var(--art-h) / 200);      /* one scene unit in px, before zoom */
  --z: 1; --sx: 0; --you-x: -300;
  position: relative; height: var(--art-h);
  width: 100vw; margin-left: calc(50% - 50vw);   /* full bleed; #join clips the overflow */
  isolation: isolate;
  -webkit-user-select: none; user-select: none;
}
.art-queue .aq-svg { position: absolute; inset: 0; display: block; width: 100%; height: 100%; max-width: none; overflow: hidden; }

/* zoom about the bottom centre (scene 0,0), then shift */
.art-queue .aq-scene {
  transform-box: view-box; transform-origin: 0 0;
  transform: scale(var(--z)) translateX(calc(var(--sx) * 1px));
}
.art-queue .aq-you { transform: translateX(calc(var(--you-x) * 1px)); }

/* ---------- Your spot ------------------------------------------------ */
.art-queue .aq-spot-fill { fill: #7C8CC5; opacity: .24; }
.art-queue .aq-spot-ring { fill: none; stroke: #24409E; stroke-width: 1.3; stroke-dasharray: 3 2.4; vector-effect: non-scaling-stroke; }
.art-queue .aq-ghost { fill: rgba(124,140,197,.2); stroke: #24409E; stroke-width: 1.3; stroke-dasharray: 3.2 2.6; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.art-queue .aq-me, .art-queue .aq-me-sh { opacity: 0; }

/* the tag: a pill floating over the empty spot, centred on it */
.art-queue .aq-tag {
  --tag-w: 100px;
  position: absolute; z-index: 2;
  left: calc(50% + (var(--you-x) + var(--sx)) * var(--z) * var(--u));
  bottom: calc(42 * var(--z) * var(--u) + 10px);
  translate: -50% 0;
  display: grid; place-items: center;
  width: var(--tag-w); height: 26px; padding: 0 0 0 .1em; border-radius: 999px;   /* .1em balances the trailing letter-spacing */
  background: #F2F4F1; border: 1.5px solid #24409E; color: #24409E;
  font-family: var(--f-mono, ui-monospace, monospace); font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase;
  line-height: 1; white-space: nowrap;
  box-shadow: 0 2px 0 rgba(36,64,158,.18);   /* a flat offset, no glow */
}
.art-queue .aq-tag::after { /* a short tick down to the head */
  content: ""; position: absolute; left: 50%; top: 100%; width: 1.5px; height: 8px; translate: -50% 1.5px;
  background: #24409E; opacity: .55;
}
.art-queue .aq-tag > span { grid-area: 1 / 1; transition: opacity .35s ease; }
.art-queue .aq-tag-b { opacity: 0; }
@media (max-width: 560px) { .art-queue .aq-tag { --tag-w: 106px; font-size: 12.5px; height: 28px; } }

/* ---------- is-in: you appear in your spot --------------------------- */
.art-queue.is-in .aq-me, .is-in .art-queue .aq-me,
.art-queue.is-in .aq-me-sh, .is-in .art-queue .aq-me-sh { opacity: 1; }
.art-queue.is-in .aq-ghost, .is-in .art-queue .aq-ghost { opacity: 0; }
.art-queue.is-in .aq-spot-fill, .is-in .art-queue .aq-spot-fill { opacity: 0; }
.art-queue.is-in .aq-spot-ring, .is-in .art-queue .aq-spot-ring { opacity: 0; }
.art-queue.is-in .aq-tag, .is-in .art-queue .aq-tag { background: #24409E; color: #F2F4F1; }
.art-queue.is-in .aq-tag-a, .is-in .art-queue .aq-tag-a { opacity: 0; }
.art-queue.is-in .aq-tag-b, .is-in .art-queue .aq-tag-b { opacity: 1; }

/* ---------- Layouts ------------------------------------------------- */
/* @gen:layout (written by gen/queue.py; edit LAYOUTS there) */
@media (min-width: 1392px) {  /* wide: 12 neighbours */
  .art-queue { --z: 1; --sx: 0; --you-x: -244.3; }
  .art-queue .aq-p:nth-child(n+13) { display: none; }
}
@media (min-width: 1200px) and (max-width: 1391.98px) {  /* desk: 14 neighbours */
  .art-queue { --z: 1; --sx: 0; --you-x: -272.8; }
  .art-queue .aq-p:nth-child(n+15) { display: none; }
}
@media (min-width: 900px) and (max-width: 1199.98px) {  /* lap: 11 neighbours */
  .art-queue { --z: 1.1; --sx: 0; --you-x: -228.5; }
  .art-queue .aq-p:nth-child(n+12) { display: none; }
}
@media (min-width: 700px) and (max-width: 899.98px) {  /* tab: 7 neighbours */
  .art-queue { --z: 1.2; --sx: -10; --you-x: -140.9; }
  .art-queue .aq-p:nth-child(n+8) { display: none; }
}
@media (min-width: 561px) and (max-width: 699.98px) {  /* tabs: 5 neighbours */
  .art-queue { --z: 1.2; --sx: -14; --you-x: -94.2; }
  .art-queue .aq-p:nth-child(n+6) { display: none; }
}
@media (min-width: 480px) and (max-width: 560.98px) {  /* phonel: 4 neighbours */
  .art-queue { --z: 1.2; --sx: -12; --you-x: -70.3; }
  .art-queue .aq-p:nth-child(n+5) { display: none; }
}
@media (min-width: 421px) and (max-width: 479.98px) {  /* phone: 3 neighbours */
  .art-queue { --z: 1.2; --sx: -12; --you-x: -51.4; }
  .art-queue .aq-p:nth-child(n+4) { display: none; }
}
@media (min-width: 380px) and (max-width: 420.98px) {  /* phones: 3 neighbours */
  .art-queue { --z: 1.2; --sx: -8; --you-x: -51.4; }
  .art-queue .aq-p:nth-child(n+4) { display: none; }
}
@media (max-width: 379.98px) {  /* tiny: 2 neighbours */
  .art-queue { --z: 1.2; --sx: -10; --you-x: -36.8; }
  .art-queue .aq-p:nth-child(n+3) { display: none; }
}
/* @gen:end */

/* ---------- Motion (only when queue.js arms it; reduced motion = final state) */
.art-queue .aq-doordim, .art-queue .aq-lamp { opacity: 0; }
@media (prefers-reduced-motion: no-preference) {
  .art-queue .aq-me { transition: opacity .5s ease, transform .9s cubic-bezier(.16,1,.3,1); }
  .art-queue .aq-me-sh { transition: opacity .6s ease; }
  .art-queue:not(.is-in) .aq-me { transform: translateY(14px); }
  .art-queue .aq-ghost, .art-queue .aq-spot-fill, .art-queue .aq-spot-ring { transition: opacity .4s ease; }
  .art-queue .aq-tag { transition: background-color .4s ease, color .4s ease; }

  /* before it is seen, the line stands one step back and the door is shut */
  .art-queue.aq-armed .aq-step { transform: translateX(-7px); }
  .art-queue.aq-armed .aq-doordim, .art-queue.aq-armed .aq-lamp { opacity: 1; }
  .art-queue.aq-armed.is-seen .aq-step {
    transform: none;
    transition: transform 1s cubic-bezier(.45,0,.2,1) calc(var(--i) * 60ms);
    animation: aq-step 1s cubic-bezier(.45,0,.2,1) calc(var(--i) * 60ms) 1 both;
  }
  .art-queue.aq-armed.is-seen .aq-doordim { opacity: 0; transition: opacity 1.2s ease .2s; }
  .art-queue.aq-armed.is-seen .aq-lamp { opacity: 0; transition: opacity 1.2s ease .5s; }
  /* the one idle: the dog's tail, a slow wag every few seconds */
  .art-queue.aq-armed.is-seen .aq-tail { transform-box: fill-box; transform-origin: 100% 100%; animation: aq-wag 5.5s ease-in-out 2s infinite; }
}
@keyframes aq-step { 0%, 100% { translate: 0 0; } 45% { translate: 0 -1.2px; } }
@keyframes aq-wag { 0%, 70%, 100% { rotate: 0deg; } 76% { rotate: -14deg; } 82% { rotate: 6deg; } 88% { rotate: -10deg; } 94% { rotate: 2deg; } }
