/* The Pointless Queue — one stylesheet, mobile first.
   An unnecessarily official government service. */

@font-face {
  font-family: "Public Sans";
  src: url("/fonts/public-sans-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Public Sans";
  src: url("/fonts/public-sans-latin-600-normal.woff2") format("woff2");
  font-weight: 500 700;
  font-display: swap;
}
@font-face {
  font-family: "Public Sans";
  src: url("/fonts/public-sans-latin-800-normal.woff2") format("woff2");
  font-weight: 800 900;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2");
  font-weight: 400 500;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/fonts/ibm-plex-mono-latin-600-normal.woff2") format("woff2");
  font-weight: 600 700;
  font-display: swap;
}
@font-face {
  font-family: "DM Serif Display";
  src: url("/fonts/dm-serif-display-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "UnifrakturMaguntia";
  src: url("/fonts/unifrakturmaguntia-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  --paper: #f7f5ef;
  --paper-deep: #ece8dd;
  --ink: #292723;
  --red: #b64a42;
  --red-deep: #963a33;
  --grey: #77736b;
  --grey-text: #6a665e; /* grey, darkened slightly for small text contrast */
  --yellow: #e8d8a8;
  --white: #ffffff;
  --rule: 2px solid var(--ink);
  --serif: "DM Serif Display", Georgia, "Times New Roman", serif;
  --sans: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --gutter: 20px;
  --max: 1080px;
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.55 var(--sans);
  overflow-x: hidden;
}
img,
svg {
  max-width: 100%;
}
a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover {
  color: var(--red);
}
h1,
h2,
h3 {
  font-family: var(--sans);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.025em;
  margin: 0 0 0.4em;
}
h1 {
  font-size: clamp(2.4rem, 8vw, 4.6rem);
}
h2 {
  font-size: clamp(1.7rem, 5vw, 2.4rem);
}
p {
  margin: 0 0 1em;
}
.mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 14px;
  z-index: 10;
}
.skip:focus {
  top: 12px;
}

/* ------------------------------------------------------------------ Header & footer */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 14px var(--gutter);
  border-bottom: var(--rule);
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}
.header-dept {
  display: none;
  font-size: 0.85rem;
  color: var(--grey-text);
}
@media (min-width: 640px) {
  .header-dept {
    display: inline;
  }
}

main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
main > section {
  margin: 56px 0;
}

.site-footer {
  max-width: var(--max);
  margin: 72px auto 0;
  padding: 28px var(--gutter) 40px;
  border-top: var(--rule);
  font-size: 0.9rem;
}
.footer-tag {
  font-weight: 600;
  font-size: 1rem;
}
.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-bottom: 14px;
}
.footer-small {
  color: var(--grey-text);
  font-size: 0.82rem;
}

/* ------------------------------------------------------------------ Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.2em;
  min-height: 48px;
  padding: 10px 20px;
  border: 2px solid var(--ink);
  border-radius: 4px;
  background: var(--white);
  color: var(--ink);
  font: 700 1rem/1.2 var(--sans);
  text-decoration: none;
  cursor: pointer;
}
.btn:hover {
  color: var(--ink);
  background: var(--paper-deep);
}
.btn-primary {
  background: var(--red);
  border-color: var(--red);
  color: var(--white);
}
.btn-primary:hover {
  background: var(--red-deep);
  border-color: var(--red-deep);
  color: var(--white);
}
.btn-secondary {
  background: var(--yellow);
}
.btn-big {
  font-size: 1.15rem;
  min-height: 56px;
  padding: 12px 26px;
}
.btn-block {
  width: 100%;
}
.btn[disabled] {
  cursor: progress;
  opacity: 0.85;
}
.btn.is-loading::after {
  content: "";
  width: 1em;
  height: 1em;
  margin-left: 0.4em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ------------------------------------------------------------------ Shared bits */
.kicker {
  font-size: 0.9rem;
  color: var(--grey-text);
  margin-bottom: 0.6em;
}
.section-note {
  color: var(--grey-text);
}
.notice {
  border-left: 4px solid var(--ink);
  background: var(--paper-deep);
  padding: 12px 16px;
}
.notice-error {
  border-color: var(--red);
}
.form-sheet {
  background: var(--white);
  border: 1px solid #cfc9bc;
  border-top: 6px solid var(--ink);
  padding: 24px 20px;
}
@media (min-width: 640px) {
  .form-sheet {
    padding: 36px 40px;
  }
}

/* ------------------------------------------------------------------ Live queue (homepage) */
.live {
  margin: 36px 0 56px !important;
}
.live-intro h1 {
  font-size: clamp(2rem, 6.5vw, 3.4rem);
  margin-bottom: 0.1em;
}
.hero-sub {
  font-weight: 700;
  font-size: clamp(1.3rem, 4.5vw, 1.9rem);
  letter-spacing: -0.01em;
  color: var(--red);
  margin-bottom: 0.8em;
}
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  margin-top: 26px;
}
.hero-alt {
  font-size: 0.95rem;
  color: var(--grey-text);
}

.scene {
  display: block;
  width: 100%;
  height: auto;
}

/* Gentle shuffling while waiting */
.scene .bob {
  animation: bob 3.4s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: bottom center;
}
.scene .person:nth-child(3n) .bob {
  animation-delay: -1.1s;
  animation-duration: 3.9s;
}
.scene .person:nth-child(3n + 1) .bob {
  animation-delay: -2.3s;
}
.scene .person:nth-child(4n) .bob {
  animation-duration: 4.4s;
}
@keyframes bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-1.5px) rotate(-0.6deg);
  }
}

.live-figures {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 14px 28px;
  margin: 26px 0 8px;
}
.led {
  background: #1a1917;
  border: 6px solid #3a3833;
  border-radius: 6px;
  padding: 10px 18px 12px;
}
.led-label {
  font: 700 0.8rem/1 var(--sans);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #d8d3c7;
  margin: 0 0 6px;
}
.led-number {
  font: 600 clamp(2.6rem, 12vw, 3.6rem)/1 var(--mono);
  font-variant-numeric: tabular-nums;
  color: #ff4b3a;
  letter-spacing: 0.06em;
  margin: 0;
}
.live-count {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.count-number {
  font: 800 clamp(2.4rem, 10vw, 3.6rem)/1 var(--sans);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  margin: 0;
}
.count-small {
  font-size: clamp(1.5rem, 6vw, 2.1rem);
}
.count-label {
  margin: 4px 0 0;
  color: var(--grey-text);
}
.live-scene {
  margin: 0 calc(-1 * var(--gutter));
  overflow: hidden;
}
.live-scene.is-stepping .line {
  animation: step-forward 1.1s ease-out;
}
.front-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 2px solid var(--ink);
  max-width: 640px;
}
.front-list li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: baseline;
  padding: 8px 0;
  border-bottom: 1px solid #ddd8cc;
}
.front-list li:first-child {
  font-weight: 700;
}
.front-number {
  color: var(--red);
  font-weight: 600;
}
.front-name {
  overflow-wrap: anywhere;
}
.front-name.is-anon {
  color: var(--grey-text);
  font-style: italic;
}
.front-wait {
  font-size: 0.85rem;
  color: var(--grey-text);
  text-align: right;
}
.front-empty {
  border-top: 2px solid var(--ink);
  padding-top: 12px;
}
.live-note {
  font-size: 0.88rem;
  color: var(--grey-text);
  margin: 14px 0 0;
}
.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2f9e44;
  margin-right: 4px;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  50% {
    opacity: 0.3;
  }
}
.join-intro {
  font-size: 1.05rem;
}

/* ------------------------------------------------------------------ Join form */
.join {
  max-width: 640px;
}
.join h2 {
  margin-top: 4px;
}
.field {
  margin: 0 0 22px;
  border: 0;
  padding: 0;
}
.field label,
.field legend {
  display: block;
  font-weight: 600;
  margin-bottom: 4px;
}
.optional {
  font-weight: 400;
  color: var(--grey-text);
}
.hint {
  display: block;
  font-size: 0.9rem;
  color: var(--grey-text);
  margin: 0 0 8px;
  font-weight: 400;
}
.field input[type="text"],
.field input[type="email"] {
  width: 100%;
  min-height: 50px;
  padding: 10px 12px;
  border: 2px solid var(--ink);
  border-radius: 3px;
  background: var(--white);
  font: 1.05rem var(--sans);
  color: var(--ink);
}
.field input:focus {
  background: var(--white);
}
.has-error input[type="text"],
.has-error input[type="email"] {
  border-color: var(--red);
}
.error {
  color: var(--red);
  font-weight: 600;
  font-size: 0.92rem;
  margin: 6px 0 0;
}
.field-check {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
}
.field-check label {
  font-weight: 400;
  margin: 0;
}
.field-check .hint {
  margin-top: 4px;
}
.field-check .error {
  grid-column: 1 / -1;
}
.field-check input[type="checkbox"] {
  appearance: none;
  width: 26px;
  height: 26px;
  margin: 0;
  border: var(--rule);
  background: var(--white);
  display: grid;
  place-content: center;
  cursor: pointer;
}
.field-check input[type="checkbox"]::before {
  content: "✓";
  font: 700 18px/1 var(--mono);
  color: var(--red);
  transform: scale(0);
  transition: transform 0.12s ease;
}
.field-check input[type="checkbox"]:checked::before {
  transform: scale(1) rotate(-8deg);
}
.currency-options {
  display: flex;
  gap: 10px;
}
.currency-option {
  flex: 1;
  margin: 0 !important;
  font-weight: 400 !important;
}
.currency-option input {
  position: absolute;
  opacity: 0;
}
.currency-option span {
  display: block;
  text-align: center;
  border: 2px solid var(--ink);
  border-radius: 3px;
  padding: 10px;
  font: 700 1.2rem var(--sans);
  cursor: pointer;
  background: var(--white);
}
.currency-option small {
  font-size: 0.75rem;
  color: var(--grey-text);
}
.currency-option input:checked + span {
  background: var(--yellow);
  box-shadow: inset 0 0 0 2px var(--ink);
}
.currency-option input:focus-visible + span {
  outline: 3px solid var(--red);
  outline-offset: 2px;
}
.small-print {
  font-size: 0.92rem;
  background: var(--paper);
  border-left: 4px solid var(--grey);
  padding: 14px 16px 2px;
  margin-bottom: 22px;
}
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.pay-note {
  text-align: center;
  font-size: 0.85rem;
  color: var(--grey-text);
  margin-top: 12px;
}

/* ------------------------------------------------------------------ How it works */
.steps {
  margin: 0;
  padding-left: 1.6em;
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.7;
}
.steps li::marker {
  color: var(--red);
}

/* ------------------------------------------------------------------ Arrivals / register */
.arrivals {
  list-style: none;
  padding: 0;
  margin: 0 0 18px;
  border-top: var(--rule);
}
.arrival {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 2px 14px;
  align-items: baseline;
  padding: 10px 2px;
  border-bottom: 1px solid #d4cfc3;
}
.arrival-number {
  font-family: var(--mono);
  font-weight: 600;
  color: var(--red);
}
.arrival-name {
  font-weight: 600;
  overflow-wrap: anywhere;
}
.arrival-status {
  font-size: 0.8rem;
  color: var(--grey-text);
}
.is-served .arrival-status {
  color: var(--grey-text);
}
.arrival-date {
  grid-column: 2 / -1;
  font-size: 0.82rem;
  color: var(--grey-text);
}
.tabs {
  display: flex;
  gap: 8px;
  margin: 20px 0 14px;
}
.tabs a {
  padding: 8px 14px;
  border: 2px solid var(--ink);
  border-radius: 3px;
  text-decoration: none;
  background: var(--white);
  font-weight: 700;
  font-size: 0.92rem;
}
.tabs a[aria-current="page"] {
  background: var(--ink);
  color: var(--paper);
}
.pager {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

/* ------------------------------------------------------------------ Department */
.dept {
  display: grid;
  gap: 20px;
  align-items: start;
  border-top: var(--rule);
  padding-top: 36px;
}
.dept-seal img {
  display: block;
  transform: rotate(-8deg);
}
@media (min-width: 640px) {
  .dept {
    grid-template-columns: 140px 1fr;
  }
}

/* ------------------------------------------------------------------ Prose pages */
.prose {
  max-width: 720px;
  margin: 40px auto !important;
}
.prose h1 {
  font-size: clamp(2.2rem, 7vw, 3.2rem);
}
.prose h2 {
  font-size: 1.5rem;
  margin-top: 1.4em;
}
.prose li {
  margin-bottom: 0.4em;
}
.register {
  max-width: 760px;
  margin: 40px auto !important;
}

.center-card {
  max-width: 560px;
  margin: 72px auto !important;
  text-align: center;
}
.loading {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 24px 0;
}
.loading span {
  width: 14px;
  height: 22px;
  border: 2px solid var(--ink);
  background: var(--yellow);
  animation: shuffle 1.2s ease-in-out infinite;
}
.loading span:nth-child(2) {
  animation-delay: 0.15s;
}
.loading span:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes shuffle {
  0%,
  60%,
  100% {
    transform: translateX(0);
  }
  30% {
    transform: translateX(-6px);
  }
}

/* ------------------------------------------------------------------ Tracking page */
.track-head {
  margin: 40px 0 24px !important;
  max-width: 760px;
}
.track-head h1 {
  font-size: clamp(2.1rem, 7vw, 3.6rem);
}
.lede {
  font-size: 1.15rem;
}

.ticket {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  max-width: 640px;
  background: var(--yellow);
  border: 1px solid #b9ab80;
  border-radius: 3px;
  margin: 0 0 28px;
}
.ticket-main {
  padding: 22px 20px 16px;
}
.ticket-dept,
.ticket-title {
  font-size: 1.05rem;
  font-weight: 800;
  padding-bottom: 10px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--ink);
}
.ticket-dept {
  font-size: 0.72rem;
  color: var(--grey-text);
}
.ticket-title {
  font-size: 1.05rem;
  font-weight: 600;
  padding-bottom: 12px;
  margin-bottom: 8px;
  border-bottom: 2px dashed var(--ink);
}
.ticket-rows {
  margin: 0;
}
.ticket-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(41, 39, 35, 0.2);
}
.ticket-row dt {
  font-size: 0.92rem;
}
.ticket-row dd {
  margin: 0;
  font-family: var(--mono);
  font-weight: 600;
  text-align: right;
  overflow-wrap: anywhere;
}
.ticket-small {
  font-size: 0.78rem;
  color: var(--grey-text);
  margin: 12px 0 0;
}
.ticket-stub {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px;
  border-top: 2px dashed var(--ink);
  font-family: var(--mono);
  background: var(--paper);
}
.stub-label {
  font-size: 0.8rem;
}
.stub-number {
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--red);
}
@media (min-width: 600px) {
  .ticket {
    grid-template-columns: 1fr 120px;
  }
  .ticket-stub {
    flex-direction: column;
    border-top: 0;
    border-left: 2px dashed var(--ink);
  }
  .stub-number {
    writing-mode: vertical-rl;
    font-size: 1.9rem;
  }
}
.stamp {
  position: absolute;
  right: 18px;
  top: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 3px double var(--red);
  color: var(--red);
  padding: 4px 10px;
  font: 600 1.05rem/1.1 var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  transform: rotate(-10deg);
  opacity: 0.8;
  pointer-events: none;
}
.stamp small {
  font-size: 0.6rem;
  letter-spacing: 0.04em;
}
@media (min-width: 600px) {
  .stamp {
    right: 140px;
  }
}
.ticket.is-new .stamp {
  animation: stamp 0.5s cubic-bezier(0.2, 1.6, 0.4, 1) 0.6s both;
}
@keyframes stamp {
  0% {
    opacity: 0;
    transform: rotate(-10deg) scale(2.4);
  }
  100% {
    opacity: 0.8;
    transform: rotate(-10deg) scale(1);
  }
}

.track-scene {
  border-bottom: var(--rule);
  margin: 0 0 24px;
  max-width: 760px;
  overflow: hidden;
}
.track-scene.is-stepping .line {
  animation: step-forward 1.1s ease-out;
}
@keyframes step-forward {
  from {
    transform: translateX(42px);
  }
  to {
    transform: translateX(0);
  }
}

.refresh-notice {
  max-width: 640px;
  border: 2px solid var(--ink);
  padding: 18px 20px;
  background: var(--white);
  margin: 0 0 40px !important;
}
.refresh-title {
  font: 800 1.2rem/1.25 var(--sans);
  text-transform: uppercase;
  margin-bottom: 0.2em;
}
.refresh-body {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 0.4em;
}
.refresh-small {
  font-size: 0.85rem;
  color: var(--grey-text);
}
.status-message {
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid #ddd8cc;
  font-size: 0.92rem;
  font-style: italic;
  color: var(--grey-text);
  transition: opacity 0.4s ease;
}
.status-message.is-fading {
  opacity: 0;
}

.share {
  max-width: 640px;
}
.share h2 {
  font-size: 1.6rem;
}
.copy-row {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.copy-row input {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  padding: 8px 10px;
  border: var(--rule);
  font: 0.85rem var(--mono);
  background: var(--paper);
}
.share-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}
.share-hint {
  font-size: 0.85rem;
  color: var(--grey-text);
}

/* ------------------------------------------------------------------ The reveal */
.reveal {
  max-width: 760px;
  margin: 32px auto !important;
  text-align: center;
}
.stage {
  border-bottom: var(--rule);
  margin-bottom: 10px;
}
.stage .walker {
  transform: translateX(560px);
  transition: transform 2.2s cubic-bezier(0.45, 0, 0.4, 1);
}
.stage.is-at-counter .walker {
  transform: translateX(300px);
}
.stage .bob {
  animation: none;
}
.stage.is-walking .walker .bob {
  animation: walk 0.36s ease-in-out infinite;
}
@keyframes walk {
  50% {
    transform: translateY(-3px);
  }
}
.stage .shutter {
  transform: translateY(-58px);
  transition: transform 0.7s cubic-bezier(0.6, 0, 0.9, 0.6);
}
.stage.is-shut .shutter {
  transform: translateY(0);
}
.stage .lamp {
  transition: opacity 0.2s;
}
.stage.is-checking .lamp {
  animation: blink 0.5s steps(2) infinite;
}
@keyframes blink {
  50% {
    opacity: 0.15;
  }
}
.reveal-step {
  min-height: 2em;
  font: 700 1.3rem var(--sans);
  margin: 6px 0 12px;
}
.dots span {
  animation: dot 1.2s infinite;
  opacity: 0;
}
.dots span:nth-child(2) {
  animation-delay: 0.2s;
}
.dots span:nth-child(3) {
  animation-delay: 0.4s;
}
@keyframes dot {
  30%,
  70% {
    opacity: 1;
  }
}
.reveal-final {
  transition: opacity 0.6s ease;
}
.reveal-final.is-hidden {
  opacity: 0;
  visibility: hidden;
}
.reveal:not(.is-playing) .reveal-step {
  display: none;
}
.sold-out {
  font-size: clamp(3rem, 13vw, 6.5rem);
  color: var(--red);
  margin: 0.1em 0 0.15em;
}
.sold-out:focus {
  outline: none;
}
.thanks {
  font-weight: 700;
  font-size: 1.5rem;
}
.waited {
  font-size: 1.1rem;
}
.reveal-actions,
.reveal .share-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 22px;
}

/* ------------------------------------------------------------------ Certificate */
.cert-wrap {
  margin: 36px auto 0;
  max-width: 900px;
}
.certificate {
  background: var(--white);
  border: 6px double var(--ink);
  padding: 10px;
  box-shadow: 0 10px 30px rgba(41, 39, 35, 0.15);
}
.cert-inner {
  position: relative;
  border: 8px solid var(--yellow);
  outline: 2px solid var(--ink);
  outline-offset: -14px;
  padding: 112px 22px 28px;
  text-align: center;
  background: var(--paper) url("/guilloche.svg") center / 220px repeat;
  overflow: hidden;
}
.cert-dept {
  font: 600 0.85rem var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  margin-bottom: 0.6em;
}
.cert-title {
  margin: 0 0 0.6em;
}
.cert-official {
  display: block;
  font: 600 0.9rem var(--mono);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 0.3em;
}
.cert-main {
  display: block;
  font-family: "UnifrakturMaguntia", var(--serif);
  font-size: clamp(2rem, 7vw, 3.6rem);
  line-height: 1.1;
}
.cert-line {
  font-style: italic;
  color: var(--grey-text);
  margin: 0.5em 0 0.2em;
}
.cert-name {
  font-family: var(--serif);
  font-size: clamp(2.2rem, 8vw, 3.8rem);
  line-height: 1.1;
  margin: 0.1em auto 0.15em;
  padding: 0 0 6px;
  border-bottom: 1.5px solid var(--ink);
  max-width: 560px;
  overflow-wrap: anywhere;
}
.cert-ticket {
  font-weight: 600;
  margin-bottom: 0.6em;
}
.cert-waited {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 5vw, 2.2rem);
  margin: 0.1em 0;
}
.cert-noted {
  font-weight: 600;
  margin: 1.2em 0 1.6em;
}
.cert-foot {
  display: grid;
  gap: 20px;
  align-items: end;
  text-align: left;
}
.cert-details {
  margin: 0;
  font-size: 0.82rem;
}
.cert-details div {
  display: flex;
  gap: 10px;
}
.cert-details dt {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  min-width: 6.5em;
  color: var(--grey-text);
}
.cert-details dd {
  margin: 0;
}
.cert-sign {
  text-align: center;
  font-size: 0.85rem;
}
.cert-sign svg {
  display: block;
  margin: 0 auto;
  border-bottom: 1.5px solid var(--ink);
}
.cert-sign p {
  margin: 6px 0 0;
}
.cert-seal {
  position: absolute;
  top: 20px;
  left: 16px;
  width: 78px;
  height: 78px;
  transform: rotate(-12deg);
}
.cert-stamp {
  position: absolute;
  top: 28px;
  right: 12px;
  margin: 0;
  border: 4px double var(--red);
  color: var(--red);
  font: 600 1.05rem var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 4px 10px;
  transform: rotate(12deg);
  opacity: 0.85;
}
@media (min-width: 720px) {
  .cert-inner {
    padding: 60px 70px 40px;
  }
  .cert-foot {
    grid-template-columns: 1fr auto;
  }
  .cert-seal {
    width: 132px;
    height: 132px;
    top: 36px;
    left: 36px;
  }
  .cert-stamp {
    top: 56px;
    right: 44px;
    font-size: 1.5rem;
  }
}
.cert-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin: 28px 0 18px;
}
.cert-note {
  text-align: center;
  font-size: 0.85rem;
  color: var(--grey-text);
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

/* ------------------------------------------------------------------ Motion & print */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .scene .bob {
    animation: none !important;
  }
}

@media print {
  @page {
    size: A4 landscape;
    margin: 10mm;
  }
  body {
    background: var(--white);
  }
  .site-header,
  .site-footer,
  .cert-actions,
  .cert-note,
  .skip {
    display: none !important;
  }
  .cert-wrap {
    margin: 0;
    max-width: none;
  }
  .certificate {
    box-shadow: none;
    break-inside: avoid;
  }
  .cert-inner {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
.tiny-print {
  text-align: center;
  font-size: 0.72rem;
  font-style: italic;
  color: var(--grey-text);
  margin: -4px 0 0;
}

.closed-notice {
  max-width: 640px;
  background: var(--ink);
  color: var(--paper);
  padding: 12px 16px;
  border-radius: 3px;
  font-weight: 600;
}

/* ------------------------------------------------------------------ Join dialog */
.join-dialog {
  width: min(560px, calc(100% - 24px));
  max-height: calc(100dvh - 24px);
  margin: auto;
  padding: 0 22px 22px;
  border: 0;
  border-top: 6px solid var(--ink);
  border-radius: 4px;
  background: var(--white);
  color: var(--ink);
  overflow: auto;
}
/* Without JavaScript, /join shows the form inline rather than as a modal. */
.join-dialog[open]:not(:modal) {
  position: static;
  margin: 32px auto;
  border: 1px solid #cfc9bc;
  border-top: 6px solid var(--ink);
}
.join-dialog::backdrop {
  background: rgba(41, 39, 35, 0.6);
}
.dialog-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--white);
  padding: 18px 0 10px;
  margin-bottom: 6px;
  border-bottom: 1px solid #ddd8cc;
}
.dialog-head h2 {
  margin: 0;
  font-size: 1.6rem;
}
.dialog-close {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  font-size: 1.8rem;
  line-height: 1;
  text-decoration: none;
  border-radius: 4px;
}
.dialog-close:hover {
  background: var(--paper-deep);
  color: var(--ink);
}
@media (min-width: 640px) {
  .join-dialog {
    padding: 0 32px 28px;
  }
}

/* ------------------------------------------------------------------ Below the queue */
.more {
  display: grid;
  gap: 8px 48px;
  margin: 56px 0;
  border-top: 2px solid var(--ink);
  padding-top: 28px;
}
.more > section {
  margin: 0;
}
.more h2,
.dept h2 {
  font-size: 1.4rem;
}
.dept {
  grid-template-columns: 72px 1fr;
  gap: 18px;
  padding-top: 28px;
}
.dept-seal {
  width: 72px;
  height: 72px;
  transform: rotate(-8deg);
}
@media (min-width: 760px) {
  .more {
    grid-template-columns: 1fr 1.3fr;
  }
}

/* The big join button, in the row with the live figures */
.join-cta {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-basis: 100%;
}
.btn-join {
  width: 100%;
  min-height: 68px;
  padding: 14px 32px;
  font-size: 1.35rem;
  font-weight: 800;
  box-shadow: 0 4px 0 var(--red-deep);
}
.btn-join:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--red-deep);
}
@media (min-width: 900px) {
  .join-cta {
    flex-basis: auto;
    margin-left: auto;
  }
  .btn-join {
    width: auto;
    min-height: 84px;
    padding: 18px 40px;
    font-size: 1.6rem;
  }
}
@media (max-width: 899px) {
  .live-count {
    flex: 1 1 130px;
  }
}

/* Homepage, simplified */
body[data-page="home"] .live {
  margin-top: 48px !important;
}
.how-line {
  font-weight: 700;
  margin: 18px 0 0;
}
.scene-live .person text {
  paint-order: stroke;
  stroke: var(--paper);
  stroke-width: 3px;
}

/* ------------------------------------------------------------------ Figures over the queue (desktop)
   The scene leaves an empty band above row 1, to the right of the booth. On wide screens the live
   figures and the Join button sit in that band. Sizes use container units (cqw) so they keep their
   place in the picture at any width. */
.live-stage {
  position: relative;
  margin: 0 calc(-1 * var(--gutter));
  container-type: inline-size;
}
.live-stage .live-figures {
  padding: 0 var(--gutter);
}
.live-stage .live-scene {
  margin: 0;
}
@media (min-width: 900px) {
  .live-stage .live-figures {
    position: absolute;
    top: 0.5cqw;
    left: 21.5cqw;
    right: 4.5cqw;
    height: 13cqw;
    margin: 0;
    padding: 0;
    flex-wrap: nowrap;
    align-items: center;
    gap: 2.6cqw;
  }
  .live-stage .led {
    border-width: 0.5cqw;
    padding: 0.8cqw 1.5cqw 1cqw;
  }
  .live-stage .led-label {
    font-size: 0.95cqw;
    margin-bottom: 0.5cqw;
  }
  .live-stage .led-number {
    font-size: 3.6cqw;
  }
  .live-stage .live-count {
    flex: 0 1 auto;
  }
  .live-stage .count-number {
    font-size: 3.6cqw;
  }
  .live-stage .count-small {
    font-size: 2.6cqw;
  }
  .live-stage .count-label {
    font-size: 1.3cqw;
    margin-top: 0.3cqw;
    max-width: 16cqw;
    line-height: 1.3;
  }
  .live-stage .join-cta {
    flex: 0 0 auto;
    margin-left: auto;
  }
  .live-stage .btn-join {
    width: auto;
    min-height: 0;
    padding: 1.4cqw 2.8cqw;
    font-size: 1.9cqw;
  }
}

/* ------------------------------------------------------------------ Character builder */
.builder-grid {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 14px 18px;
  align-items: start;
}
.builder-preview {
  background: var(--paper);
  border: 1px solid #ddd8cc;
  border-radius: 4px;
  padding: 8px;
  position: sticky;
  top: 70px;
}
.character-preview {
  display: block;
  width: 100%;
  height: auto;
}
.builder-preview.is-new .character-preview {
  animation: hop 0.35s ease-out;
}
@keyframes hop {
  40% {
    transform: translateY(-6px);
  }
}
.builder-controls {
  display: grid;
  gap: 4px;
}
.part-row {
  display: grid;
  grid-template-columns: 5.5em 32px 1fr 32px;
  align-items: center;
  gap: 4px;
  font-size: 0.92rem;
}
.part-label {
  color: var(--grey-text);
}
.part-value {
  text-align: center;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.part-btn {
  width: 32px;
  height: 32px;
  border: 2px solid var(--ink);
  border-radius: 4px;
  background: var(--white);
  font: 700 1.2rem/1 var(--sans);
  cursor: pointer;
}
.part-btn:hover {
  background: var(--paper-deep);
}
.btn-small {
  min-height: 38px;
  padding: 6px 14px;
  font-size: 0.9rem;
  justify-self: start;
  margin-top: 6px;
}
/* Without JavaScript you get a random character, and no controls. */
html:not(.js) .builder-controls {
  display: none;
}
@media (max-width: 420px) {
  .builder-grid {
    grid-template-columns: 104px 1fr;
    gap: 10px;
  }
  .part-row {
    grid-template-columns: 4.6em 30px 1fr 30px;
    font-size: 0.85rem;
  }
}

/* On phones the join dialog takes the whole screen. */
@media (max-width: 639px) {
  .join-dialog:modal {
    width: 100%;
    max-width: none;
    height: 100%;
    height: 100dvh;
    max-height: none;
    margin: 0;
    border-radius: 0;
    border-top-width: 6px;
    padding-bottom: calc(22px + env(safe-area-inset-bottom));
  }
}

/* Narrow phones: preview on top, controls full width below. */
@media (max-width: 480px) {
  .builder-grid {
    grid-template-columns: 1fr;
  }
  .builder-preview {
    position: static;
    width: 130px;
    justify-self: center;
  }
  .part-row {
    grid-template-columns: 7em 36px 1fr 36px;
    font-size: 0.95rem;
  }
  .part-btn {
    width: 36px;
    height: 36px;
  }
}

/* Phones and small tablets: a compact block of figures, so the queue starts high on the screen.
   Sign on the left, the two counts stacked beside it, the Join button underneath. */
@media (max-width: 899px) {
  .live {
    margin-top: 28px !important;
  }
  .live-intro h1,
  .live > h1 {
    font-size: clamp(1.9rem, 8vw, 2.6rem);
  }
  .hero-sub {
    margin-bottom: 0.4em;
  }
  .live-stage .live-figures {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto auto;
    gap: 8px 16px;
    align-items: center;
    margin: 18px 0 6px;
  }
  .live-stage .led {
    grid-row: 1 / span 2;
    border-width: 4px;
    padding: 8px 12px 10px;
  }
  .live-stage .led-label {
    font-size: 0.68rem;
    margin-bottom: 4px;
  }
  .live-stage .led-number {
    font-size: clamp(1.6rem, 7.5vw, 2.4rem);
  }
  .live-stage .live-count {
    flex: none;
  }
  .live-stage .count-number,
  .live-stage .count-small {
    font-size: clamp(1.4rem, 6vw, 1.9rem);
  }
  .live-stage .count-label {
    font-size: 0.8rem;
    line-height: 1.25;
    margin-top: 2px;
  }
  .live-stage .join-cta {
    grid-column: 1 / -1;
    margin-top: 6px;
  }
  .live-stage .btn-join {
    min-height: 56px;
    font-size: 1.2rem;
  }
}

.hero-aside {
  color: var(--grey-text);
  font-weight: 500;
  font-size: 0.72em;
  white-space: nowrap;
}

/* The footer: one quiet line, like the small print on a form. */
.site-footer {
  border-top: 0;
  margin-top: 48px;
  padding: 0 var(--gutter) 36px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--grey-text);
}
.site-footer p {
  margin: 0;
}
.footer-links {
  white-space: nowrap;
  margin-left: 0.6em;
}
.footer-links a {
  color: inherit;
}

/* ------------------------------------------------------------------ Homepage on phones, take two
   One strip of figures (sign, waiting, needed-to-open), the queue straight underneath,
   and the Join button fixed to the bottom of the screen. */
@media (max-width: 899px) {
  .live-stage .live-figures {
    grid-template-columns: auto 1fr 1fr;
    grid-template-rows: auto;
    gap: 0 14px;
    align-items: center;
    margin: 16px 0 4px;
  }
  .live-stage .led {
    grid-row: auto;
    border-width: 3px;
    padding: 6px 10px 8px;
  }
  .live-stage .led-label {
    font-size: 0.6rem;
    margin-bottom: 3px;
  }
  .live-stage .led-number {
    font-size: clamp(1.3rem, 6.4vw, 2rem);
  }
  .live-stage .count-number,
  .live-stage .count-small {
    font-size: clamp(1.3rem, 6vw, 1.8rem);
  }
  .live-stage .count-label {
    font-size: 0.75rem;
  }
  body[data-page="home"] .live-stage .join-cta {
    position: fixed;
    z-index: 5;
    left: 0;
    right: 0;
    bottom: 0;
    margin: 0;
    padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom));
    background: var(--paper);
    border-top: 1px solid #ddd8cc;
  }
  body[data-page="home"] .live-stage .btn-join {
    width: 100%;
    min-height: 54px;
  }
  /* Room for the fixed button at the end of the page. */
  body[data-page="home"] {
    padding-bottom: calc(84px + env(safe-area-inset-bottom));
  }
}
.arrival-name.is-anon {
  color: var(--grey-text);
  font-weight: 400;
}
@media (max-width: 480px) {
  .tabs a {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
  }
}
.small-print .climate-note {
  border-top: 1px dashed #cfc9bc;
  padding-top: 10px;
}

/* ------------------------------------------------------------------ Opening progress */
.opening {
  max-width: 760px;
  margin: 18px 0 0;
}
.opening-text {
  font-size: 0.95rem;
  margin: 0 0 8px;
}
.opening-bar {
  display: block;
  width: 100%;
  height: 14px;
  border: 2px solid var(--ink);
  border-radius: 3px;
}
.opening.is-compact {
  margin: 0;
}
.opening.is-compact .opening-text {
  font-size: 0.88rem;
}
.closed-progress {
  max-width: 640px;
  margin: -14px 0 24px;
  padding: 12px 16px 14px;
  border: 2px solid var(--ink);
  border-top: 0;
  border-radius: 0 0 3px 3px;
  background: var(--white);
}
.nudge {
  margin: 10px 0 0;
  font-weight: 700;
  font-size: 0.92rem;
}

/* Limited tickets */
.limit-line {
  margin: 12px 0 0;
  font-size: 0.95rem;
}
.of-limit {
  font-weight: 400;
  font-size: 0.8em;
  color: var(--grey-text);
}
.btn-join.is-gone {
  background: var(--paper-deep);
  border-color: var(--grey);
  color: var(--grey-text);
  cursor: not-allowed;
  box-shadow: none;
}
/* The opening progress bar spans the page on desktop. */
@media (min-width: 900px) {
  .opening {
    max-width: none;
  }
}

/* "We're not sure what for… (a piece of internet history?)" stays on one line at every width:
   the size scales with the screen, capped at the desktop size. */
.hero-sub {
  font-size: min(3.9vw, 1.9rem);
  white-space: nowrap;
}
