/* Velvet Rope · the cloakroom and the ticket back to the list (home page only)
   Short answers as coat-check tickets, and the one nudge: a ticket that slides up on phones once the visitor has
   walked past the list without putting a name down. The house rules board lives in styles.css. */

/* ---------- Short answers: coat-check tickets ----------
   One question to a ticket. A narrow stub carries the number and the hole for the hanger; a perforated line with a
   punched notch at each end separates it from the answer. Phones: one column. 640px: two. From 1280px the tickets
   stand upright, four across, the stub on top. */
.stubs { display: grid; gap: 14px; }
.stub {
  --stub-w: 4.75rem;
  --cut: var(--bg);  /* what shows through the notches and the hole: the section behind the ticket */
  position: relative;
  display: grid;
  grid-template-columns: var(--stub-w) minmax(0, 1fr);
  background: var(--surface);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
}
.stub__no {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 42px 4px 18px;
  border-right: 2px dashed var(--rule-strong);
  font: 400 2.5rem/.9 var(--display);
  letter-spacing: .03em;
  color: var(--accent);
}
.stub__no span {
  margin-bottom: 6px;
  font: 600 .64rem/1 var(--body);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
}
/* the notches: half circles punched where the perforation meets the edge */
.stub__no::before,
.stub__no::after {
  content: "";
  position: absolute;
  right: -8px;
  width: 18px;
  height: 18px;
  border: 1px solid var(--rule-strong);
  border-radius: 50%;
  background: var(--cut);
}
.stub__no::before { top: -10px; clip-path: inset(50% 0 0 0); }
.stub__no::after { bottom: -10px; clip-path: inset(0 0 50% 0); }
/* the hole for the hanger */
.stub::after {
  content: "";
  position: absolute;
  top: 15px;
  left: calc(var(--stub-w) / 2 - 7px);
  width: 13px;
  height: 13px;
  border: 1px solid var(--rule-strong);
  border-radius: 50%;
  background: var(--cut);
}
.stub__body { min-width: 0; padding: 18px 18px 20px; }
.stub__body h3 { font-size: 1.04rem; font-weight: 700; line-height: 1.35; }
.stub__body p { margin-top: 6px; font-size: .95rem; line-height: 1.6; color: var(--muted); }
.stubs__after { margin-top: 32px; }

@media (min-width: 640px) {
  .stubs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
}
@media (min-width: 1280px) {
  .stubs { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
  .stub { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .stub__no {
    flex-direction: row;
    align-items: baseline;
    gap: 8px;
    padding: 18px 20px 14px;
    border-right: 0;
    border-bottom: 2px dashed var(--rule-strong);
  }
  .stub__no span { margin: 0; }
  .stub__no::before { top: auto; right: auto; left: -10px; bottom: -8px; clip-path: inset(0 0 0 50%); }
  .stub__no::after { right: -10px; bottom: -8px; clip-path: inset(0 50% 0 0); }
  .stub::after { top: 23px; left: auto; right: 20px; }
  .stub__body { padding: 18px 20px 24px; }
}

/* ---------- The nudge: a ticket back to the list (phones) ----------
   Fixed to the bottom edge, so it never moves the page. Enters once, sliding up from below the screen (480ms,
   ease-out); leaves faster (220ms) the way it came. main.js decides when. */
.nudge {
  position: fixed;
  z-index: 18;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  max-width: 26rem;
  margin: 0 auto;
  filter: drop-shadow(0 12px 20px rgba(0, 0, 0, .65));
  transform: translateY(calc(100% + 24px + env(safe-area-inset-bottom, 0px)));
  opacity: 0;
  pointer-events: none;
  transition: transform 220ms var(--ease-out), opacity 220ms var(--ease-out);
}
.nudge.is-in {
  transform: none;
  opacity: 1;
  pointer-events: auto;
  transition: transform 480ms var(--ease-out), opacity 200ms var(--ease-out);
}
/* A crimson admission ticket. The x sits on its tear-off stub: two notches punched where the perforation meets
   the edges (a mask, so whatever is behind shows through). */
.nudge__ticket {
  --stub: 56px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--stub);
  background: #BC1730;
  color: #FFF4EF;
  border-radius: var(--radius);
  -webkit-mask:
    radial-gradient(circle 7px at calc(100% - var(--stub)) 0, transparent 6.5px, #000 7px) top / 100% 51% no-repeat,
    radial-gradient(circle 7px at calc(100% - var(--stub)) 100%, transparent 6.5px, #000 7px) bottom / 100% 51% no-repeat;
  mask:
    radial-gradient(circle 7px at calc(100% - var(--stub)) 0, transparent 6.5px, #000 7px) top / 100% 51% no-repeat,
    radial-gradient(circle 7px at calc(100% - var(--stub)) 100%, transparent 6.5px, #000 7px) bottom / 100% 51% no-repeat;
}
.nudge__go {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 12px 14px 12px 18px;
  color: inherit;
  text-decoration: none;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}
.nudge__title { padding-top: 2px; font: 400 1.6rem/1 var(--display); letter-spacing: .03em; }
.nudge__line { font: 600 .88rem/1.3 var(--body); text-decoration: underline; text-decoration-color: rgba(255, 244, 239, .55); text-underline-offset: 3px; }
.nudge__x {
  display: grid;
  place-items: center;
  min-height: 56px;
  padding: 0;
  border: 0;
  border-left: 2px dashed rgba(255, 244, 239, .5);
  background: transparent;
  color: inherit;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}
.nudge__x svg { transition: transform 160ms var(--ease-out); }
.nudge__x:active svg { transform: scale(.85); }
.nudge__go:active .nudge__title,
.nudge__go:active .nudge__line { opacity: .8; }
.nudge :focus-visible { outline: 2px solid #FFF4EF; outline-offset: -5px; }

@media (min-width: 768px) {
  .nudge { display: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  /* no slide: it fades in where it sits and fades out */
  .nudge, .nudge.is-in { transform: none; }
  .nudge { transition: opacity 200ms ease; }
  .nudge.is-in { transition: opacity 240ms ease; }
  .nudge__x svg { transition: none; }
  .nudge__x:active svg { transform: none; }
}
