/* Bot Bouncer: the door of a club. A dark door field with the bouncer's clipboard, the list of names, the house rules,
   questions at the door, and the door again at the close. Tokens come from styles.css. */

.bb-door, .bb-close { --bb-on-dark: var(--bg); --bb-dark-soft: #b9ddd0; background: var(--ink); color: var(--bb-on-dark); }

/* ---------- hero: the door ---------- */
.bb-door {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(40px, 5vw, 96px); align-items: center;
  padding: clamp(40px, 5vw, 80px) var(--m); margin-top: clamp(8px, 1vw, 16px);
}
.bb-door h1 { font-size: clamp(56px, 9vw, 152px); letter-spacing: -0.035em; line-height: .92; }
.bb-sub { margin-top: 28px; font: 500 var(--step-lead)/1.35 var(--f); max-width: 26em; }
.bb-intro { margin-top: 24px; font-size: 1.125rem; line-height: 1.6; max-width: 34em; }
.bb-actions { margin-top: 40px; display: flex; flex-wrap: wrap; align-items: center; gap: 16px 32px; }
.bb-btn { background: var(--bg); color: var(--ink); }
.bb-btn::before { background: var(--accent); }
.bb-btn:hover { color: var(--accent-ink); }
.bb-back { display: inline-flex; align-items: center; min-height: 44px; color: var(--bb-on-dark); }
.bb-back::after { bottom: 9px; }
@media (hover: hover) and (pointer: fine) { .bb-back:hover, .bb-close .text-link:hover { color: var(--bb-dark-soft); } }

/* the clipboard: a light sheet on the dark door */
.bb-board { background: var(--bg); color: var(--ink); padding: clamp(24px, 2.6vw, 40px); }
.bb-board-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.bb-board h2 { font-size: clamp(1.75rem, 1.3rem + 1.2vw, 2.5rem); }
.bb-badge { width: clamp(64px, 6vw, 88px); height: auto; flex: none; }
.bb-stances { margin-top: 24px; display: grid; gap: 6px; }
.bb-stance {
  min-height: 48px; padding: 10px 18px; border: 0; border-radius: 0; text-align: left; cursor: pointer;
  background: var(--surface); color: var(--ink); font: 700 var(--step-body)/1.25 var(--f);
  transition: transform 160ms var(--ease), background-color var(--t) var(--ease), color var(--t) var(--ease);
}
.bb-stance.is-on { background: var(--ink); color: var(--bg); }
.bb-stance:active, .bb-name:active, .bb-copy:active { transform: scale(.97); }
@media (hover: hover) and (pointer: fine) { .bb-stance:not(.is-on):hover { background: var(--surface-2); } }
.bb-stance-note { margin-top: 12px; min-height: 3.2em; font-size: var(--step-body); }
.bb-tally { margin-top: 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.bb-count { display: grid; gap: 2px; font-size: 1.125rem; font-weight: 700; }
.bb-count b { display: block; font: 400 clamp(56px, 5.4vw, 88px)/.9 var(--fd); letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.bb-count.is-in b { color: var(--accent-text); }
/* one mark per bot, in list order: a let-in bot stands tall in green, a kept-out bot is small and dark */
.bb-heads { margin-top: 20px; display: grid; grid-template-columns: repeat(27, minmax(0, 1fr)); gap: clamp(2px, .35vw, 5px); align-items: end; height: 48px; }
.bb-heads i { position: relative; display: block; height: 100%; background: var(--accent); transform-origin: bottom; transition: transform 420ms var(--ease-out); }
.bb-heads i::after { content: ""; position: absolute; inset: 0; background: var(--ink); opacity: 0; transition: opacity 300ms var(--ease); }
.bb-heads i.is-out { transform: scaleY(.42); }
.bb-heads i.is-out::after { opacity: 1; }
.bb-board-foot { margin-top: 20px; font-size: var(--step-body); }
.bb-board-foot .text-link { color: var(--accent-text); font-weight: 700; }

/* ---------- the list ---------- */
.bb-wall, .bb-ask { padding: var(--gap) var(--m) 0; }
.bb-wall-head { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(32px, 5vw, 96px); align-items: end; margin-bottom: clamp(40px, 5vw, 72px); }
.bb-wall-head h2, .bb-rules-head h2, .bb-ask h2, .bb-close-head h2 { font-size: var(--step-head); }
.bb-wall-head p { font-size: var(--step-lead); line-height: 1.45; }
.bb-wall-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(32px, 5vw, 96px); align-items: start; }
.bb-live { position: sticky; top: 0; z-index: 2; background: var(--bg); padding: 14px 0; font-size: 1.125rem; }
.bb-live b { display: inline-block; font-variant-numeric: tabular-nums; }
.bb-group { margin-top: 28px; display: grid; grid-template-columns: minmax(0, 9.5em) minmax(0, 1fr); gap: 4px 24px; align-items: start; }
.bb-group h3 { padding-top: .7em; font: 700 1.125rem/1.3 var(--f); letter-spacing: 0; }
.bb-group h3 span { display: block; }
.bb-group h3 span { font-weight: 400; }
.bb-names { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 2px 6px; }
.bb-name {
  position: relative; min-height: 44px; padding: .08em .26em .12em; border: 0; border-radius: 0; cursor: pointer;
  background: transparent; color: var(--ink); font: 400 clamp(1.75rem, 1.3rem + 1.2vw, 2.5rem)/1.1 var(--fd); letter-spacing: -0.02em;
  transition: transform 160ms var(--ease), background-color var(--t) var(--ease), color var(--t) var(--ease);
}
.bb-name::after {
  content: ""; position: absolute; left: .18em; right: .18em; top: 54%; height: max(3px, .09em); background: var(--ink);
  transform: scaleX(0); transform-origin: left center; transition: transform 380ms var(--ease-out);
}
.bb-name.is-out { color: var(--muted); }
.bb-name.is-out::after { transform: scaleX(1); }
@media (hover: hover) and (pointer: fine) { .bb-name:hover { background: var(--surface); } }
.bb-from { margin-top: 40px; font-size: var(--step-body); max-width: 40em; }

.bb-file { position: sticky; top: 24px; }
.bb-file-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.bb-file-head h3 { font-size: clamp(1.75rem, 1.3rem + 1.2vw, 2.5rem); }
.bb-copy {
  min-height: 44px; padding: 0 20px; border: 0; border-radius: 0; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); font: 700 var(--step-body)/1 var(--f);
  transition: transform 160ms var(--ease), background-color var(--t) var(--ease);
}
@media (hover: hover) and (pointer: fine) { .bb-copy:hover { background: var(--surface-2); } }
.bb-pre {
  margin: 0; padding: 24px; background: var(--ink); color: var(--bg); overflow: auto; max-height: min(66vh, 620px);
  font: 400 15px/1.65 var(--f-code); tab-size: 2;
}
.bb-pre code { font: inherit; }
.bb-pre .bb-c { color: var(--bb-dark-soft, #b9ddd0); }
.bb-pre.bb-swap { animation: bb-fade 360ms var(--ease-out); }
.bb-note { margin-top: 16px; font-size: var(--step-body); }
.bb-note .text-link { display: inline-flex; align-items: center; min-height: 44px; color: var(--accent-text); font-weight: 700; white-space: nowrap; }
.bb-note .text-link::after { bottom: 9px; }

/* ---------- past the door: the whole app ---------- */
.bb-rules {
  margin-top: var(--gap); padding: clamp(80px, 9vw, 144px) var(--m); background: var(--surface);
}
.bb-rules-head, .bb-rule { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 16px clamp(40px, 5vw, 96px); align-items: start; }
.bb-rules-lead { display: grid; gap: 28px; justify-items: start; max-width: 40em; }
.bb-rules-lead p { font-size: var(--step-lead); line-height: 1.45; }
.bb-rules-list { list-style: none; margin: clamp(56px, 6vw, 96px) 0 0; padding: 0; display: grid; gap: clamp(48px, 5vw, 72px); }
.bb-rule h3 { font-size: clamp(1.75rem, 1.3rem + 1.2vw, 2.5rem); grid-row: span 2; }
.bb-rule ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 14px 40px; font-size: 1.0625rem; line-height: 1.55; }
.bb-rule .text-link { grid-column: 2; }
.bb-rule .text-link { justify-self: start; display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; color: var(--accent-text); }
.bb-rule .text-link::after { bottom: 9px; }

/* ---------- asked at the door ---------- */
.bb-ask-grid { margin-top: clamp(40px, 5vw, 72px); display: grid; grid-template-columns: 1fr 1fr; gap: clamp(48px, 5vw, 72px) clamp(40px, 6vw, 112px); }
.bb-qa h3 { font-size: clamp(1.75rem, 1.3rem + 1.2vw, 2.5rem); line-height: 1.05; }
.bb-qa p { margin-top: 16px; font-size: 1.125rem; line-height: 1.6; max-width: 34em; }

/* ---------- the door again ---------- */
.bb-close { margin-top: var(--gap); padding: clamp(80px, 9vw, 144px) var(--m); }
.bb-close-head { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(32px, 5vw, 96px); align-items: end; }
.bb-close-head p { font-size: var(--step-lead); line-height: 1.45; }
.bb-moves { list-style: none; margin: clamp(48px, 6vw, 88px) 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px clamp(24px, 4vw, 64px); }
.bb-moves h3 { font-size: clamp(1.75rem, 1.3rem + 1.2vw, 2.5rem); }
.bb-moves p { margin-top: 14px; font-size: 1.0625rem; line-height: 1.6; }
.bb-close-act { margin-top: clamp(48px, 6vw, 88px); display: flex; flex-wrap: wrap; align-items: center; gap: 16px 32px; }
.bb-close-act p { font-size: var(--step-body); }

/* ---------- smaller screens ---------- */
@media (max-width: 1000px) {
  .bb-door, .bb-wall-head, .bb-wall-grid, .bb-rules-head, .bb-close-head { grid-template-columns: minmax(0, 1fr); } /* minmax: a long bot name never widens the page */
  .bb-board { max-width: 600px; }
  .bb-file { position: static; }
  .bb-pre { max-height: 480px; }
  .bb-rule { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
  .bb-rule ul { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .bb-ask-grid, .bb-moves, .bb-rule, .bb-rule ul { grid-template-columns: 1fr; }
  .bb-rule h3 { grid-row: auto; }
  .bb-rule .text-link { grid-column: auto; }
  .bb-pre { padding: 18px; }
  .bb-group { grid-template-columns: minmax(0, 1fr); }
  .bb-group h3 { padding-top: 0; }
  .bb-group h3 span { display: inline; }
  .bb-heads { height: 44px; }
  .bb-stance-note { min-height: 0; }
}
@media (max-width: 380px) {
  .bb-board { padding: 20px; }
  .bb-count b { font-size: 56px; }
  .bb-file-head { flex-wrap: wrap; }
}

/* ---------- motion: transform and opacity only, and none of it when motion is reduced ---------- */
@keyframes bb-rise { from { opacity: 0; transform: translateY(28px); } }
@keyframes bb-fade { from { opacity: .6; } }
@keyframes bb-bump { from { opacity: 0; transform: translateY(35%); } }
@media (prefers-reduced-motion: no-preference) {
  .js .bb-in-1, .js .bb-in-2, .js .bb-in-3, .js .bb-in-4, .js .bb-in-5 { animation: bb-rise 820ms var(--ease-out) backwards; }
  .js .bb-in-2 { animation-delay: 75ms; }
  .js .bb-in-3 { animation-delay: 150ms; }
  .js .bb-in-4 { animation-delay: 225ms; }
  .js .bb-in-5 { animation-delay: 300ms; }
  .bb-armed { transition: opacity 720ms var(--ease-out) var(--bb-d, 0ms), transform 720ms var(--ease-out) var(--bb-d, 0ms); }
  .bb-armed:not(.bb-seen) { opacity: 0; transform: translateY(26px); }
  .bb-bump { animation: bb-bump 420ms var(--ease-out); }
}
@media (prefers-reduced-motion: reduce) {
  .bb-stance, .bb-name, .bb-name::after, .bb-heads i, .bb-heads i::after, .bb-copy { transition: none; }
  .bb-stance:active, .bb-name:active, .bb-copy:active { transform: none; }
}
