*,
*::before,
*::after {
  box-sizing: border-box;
}

@font-face {
  font-family: "bianzhidai Bubble";
  src: url("/fonts/bianzhidai-Bubble.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "bianzhidai Brush";
  src: url("/fonts/bianzhidai-Brush.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Archivo Narrow";
  src: url("/fonts/archivo-narrow-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Archivo Narrow";
  src: url("/fonts/archivo-narrow-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #efe7d6;
  --paper-hi: #f7f1e4;
  --ink: #141210;
  --ink-soft: #3a342c;
  --accent: #ff8a2a;
  --grot: "Archivo Narrow", "Arial Narrow", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --weave: "bianzhidai Bubble", "Archivo Narrow", sans-serif;
  --gutter: max(1rem, 3vw);
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--grot);
  font-weight: 500;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  overflow-x: hidden;
}

p,
h1,
h2 {
  margin: 0;
}

a {
  color: inherit;
}

#city-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.no-city #city-canvas {
  display: none;
}

/* the moving label pinned to the lit room */
.room-tag {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 5;
  pointer-events: none;
  will-change: transform;
}

.room-tag[hidden] {
  display: none;
}

.room-tag span {
  position: absolute;
  left: 0;
  bottom: 3.2rem;
  transform: translateX(-50%);
  padding: 0.2em 0.5em 0.25em;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.room-tag span::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  width: 1px;
  height: 2.4rem;
  background: var(--ink);
}

/* poster overlay */
.poster {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100vh;
  min-height: 100dvh;
  padding: max(var(--gutter), env(safe-area-inset-top, 0px)) max(var(--gutter), env(safe-area-inset-right, 0px))
    max(2.6rem, calc(env(safe-area-inset-bottom, 0px) + 2.2rem)) max(var(--gutter), env(safe-area-inset-left, 0px));
  pointer-events: none;
}

.poster-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.hint {
  padding: 0.2em 0.45em;
  background: var(--paper);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.03em;
}

.poster-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
}

.bill {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.22rem;
  min-width: 0;
}

.wordmark {
  margin: 0 0 0.12em -0.04em;
  font-family: var(--weave);
  font-weight: 400;
  font-size: clamp(5.5rem, 15vw, 15rem);
  line-height: 0.82;
  letter-spacing: 0.01em;
  color: var(--accent);
  -webkit-text-stroke: 2px var(--ink);
  paint-order: stroke fill;
}

.bar {
  display: inline-block;
  padding: 0.04em 0.28em 0.1em;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--grot);
  font-weight: 700;
  font-size: clamp(1.25rem, 2.6vw, 2.2rem);
  line-height: 1.05;
  letter-spacing: -0.005em;
  text-transform: uppercase;
}

.bar-small {
  font-size: 0.95rem;
  letter-spacing: 0.03em;
}

.bar-quiet {
  background: var(--paper);
  color: var(--ink);
  box-shadow: inset 0 0 0 2px var(--ink);
}

/* tickets: the same black bars as the bill, with the buy button as the one orange bar */
.ticket-panel {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.22rem;
  width: min(22rem, 100%);
  pointer-events: auto;
}

.bar-price {
  font-size: clamp(3rem, 5vw, 4.4rem);
  line-height: 0.95;
  font-variant-numeric: tabular-nums;
}

.each {
  font-size: 0.4em;
  letter-spacing: 0.02em;
}

.qty {
  display: flex;
  align-items: stretch;
  gap: 0.22rem;
  margin-top: 0.3rem;
}

.qty .bar {
  display: flex;
  align-items: center;
}

.qty-btn,
.qty-value {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  border: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--grot);
  font-weight: 700;
  font-size: 1.6rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.qty-value {
  background: var(--paper);
  color: var(--ink);
  box-shadow: inset 0 0 0 2px var(--ink);
}

.qty-btn {
  cursor: pointer;
}

.qty-btn:hover:not(:disabled),
.qty-btn:focus-visible {
  background: var(--accent);
  color: var(--ink);
}

.qty-btn:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

.qty-btn:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

.strip {
  max-width: 100%;
  padding: 0.14em 0.45em 0.2em;
  background: var(--paper);
  font-family: var(--mono);
  font-size: 0.74rem;
  line-height: 1.4;
}

.strip:empty {
  display: none;
}

.pay-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.35em 0.9em 0.45em;
  border: 2px solid var(--ink);
  border-radius: 0;
  background: var(--paper-hi);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  cursor: pointer;
}

.pay-btn:hover:not(:disabled),
.pay-btn:focus-visible {
  background: var(--accent);
}

.pay-btn:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

.pay-btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.pay-submit {
  width: 100%;
  background: var(--ink);
  color: var(--paper);
  font-size: 1.35rem;
}

.pay-submit:hover:not(:disabled) {
  color: var(--ink);
}

.buy-btn {
  margin: 0.3rem 0 0.2rem;
  padding: 0.12em 0.5em 0.2em;
  border: 0;
  background: var(--accent);
  color: var(--ink);
  font-size: clamp(1.5rem, 2.8vw, 2.3rem);
  line-height: 1.05;
}

.buy-btn:hover:not(:disabled),
.buy-btn:focus-visible {
  background: var(--ink);
  color: var(--accent);
}

.pay-submit.is-busy::after {
  content: " ···";
  display: inline-block;
  animation: busy-pulse 0.9s ease-in-out infinite;
}

@keyframes busy-pulse {
  0%,
  100% {
    opacity: 0.2;
  }
  50% {
    opacity: 1;
  }
}

.ticket-err {
  min-height: 1.1em;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: #a12a12;
}

.save-warn {
  font-family: var(--mono);
  font-size: 0.74rem;
  line-height: 1.4;
}

.ticket-note {
  font-family: "bianzhidai Brush", var(--grot);
  font-size: 0.9rem;
  line-height: 1.35;
}

/* checkout sheet */
.pay-sheet {
  position: fixed;
  z-index: 30;
  top: max(0.6rem, env(safe-area-inset-top, 0px));
  right: max(0.6rem, env(safe-area-inset-right, 0px));
  left: max(0.6rem, env(safe-area-inset-left, 0px));
  max-height: calc(100dvh - 1.2rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1rem 1.1rem 1.2rem;
  background: var(--paper-hi);
  border: 2px solid var(--ink);
  box-shadow: 8px 8px 0 var(--ink);
}

.pay-sheet[hidden],
#pay-success[hidden],
#pay-form[hidden] {
  display: none;
}

.pay-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.8rem;
  font-weight: 700;
  font-size: 1.2rem;
  text-transform: uppercase;
}

.pay-close {
  font-size: 0.85rem;
}

#payment-element {
  margin: 0.35rem 0 0.8rem;
}

.wallet-hint {
  font-family: var(--mono);
  font-size: 0.78rem;
}

.pay-submit {
  margin-top: 0.4rem;
}

#sheet-door-code,
#door-code {
  margin: 0.5rem 0 0.35rem;
  padding: 0.1em 0.3em 0.18em;
  background: var(--accent);
  border: 2px solid var(--ink);
  font-weight: 700;
  font-size: clamp(1.7rem, 7vw, 2.6rem);
  line-height: 1.1;
  letter-spacing: 0.01em;
  overflow-wrap: anywhere;
}

#sheet-thanks-note,
#thanks-note {
  font-family: var(--mono);
  font-size: 0.85rem;
}

.legal-links {
  position: fixed;
  z-index: 25;
  left: max(var(--gutter), env(safe-area-inset-left, 0px));
  bottom: max(0.6rem, env(safe-area-inset-bottom, 0px));
  padding: 0.1em 0.4em;
  background: var(--paper);
  font-family: var(--mono);
  font-size: 0.72rem;
}

/* thanks, contact and the door export page */
.sky-copy.thanks-copy {
  max-width: 38rem;
  padding: max(8vh, env(safe-area-inset-top, 0px)) var(--gutter) 8vh;
  font-size: 1.1rem;
  line-height: 1.45;
}

.thanks-copy > * + * {
  margin-top: 0.7rem;
}

.contact-page {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.contact-kicker,
.type-credit {
  font-family: var(--mono);
  font-size: 0.78rem;
}

.contact-page .type-credit {
  margin-top: auto;
  padding-top: 1.6rem;
}

@media (max-width: 859px) {
  body.home {
    overflow-y: auto;
  }

  .poster {
    justify-content: flex-start;
    gap: 1rem;
  }

  .poster-top {
    margin-bottom: 40vh;
  }

  .wordmark {
    font-size: 27vw;
  }

  .poster-bottom {
    flex-direction: column;
    align-items: stretch;
    gap: 1.4rem;
  }

  .ticket-panel {
    align-items: flex-start;
  }

  .bill,
  .ticket-panel {
    pointer-events: auto;
  }

  .poster {
    padding-bottom: 1.2rem;
  }

  .legal-links {
    position: relative;
    left: auto;
    bottom: auto;
    display: inline-block;
    margin: 0 var(--gutter) max(1.2rem, env(safe-area-inset-bottom, 0px));
  }
}

@media (pointer: coarse) {
  .hint {
    display: none;
  }
}

@media (min-width: 860px) {
  .pay-sheet {
    top: 6vh;
    right: var(--gutter);
    left: auto;
    width: min(27rem, 92vw);
    max-height: 88vh;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pay-submit.is-busy::after {
    animation: none;
  }
}
