/*
  Cha Cha Cha ticket site.
  The palette is the Zambian flag re-set as a 1960s handbill:
  paper stock, ink, and the flag's green, red and orange.
*/
@font-face {
  font-family: "Alfa Slab One";
  src: url("../fonts/alfa-slab-one-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("../fonts/instrument-sans-latin-wght-normal.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --paper: #f1ead6;
  --paper-deep: #e3d9bb;
  --card: #fbf7ea;
  --ink: #1b1712;
  --ink-soft: #5a5246;
  --green: #14693a;
  --green-deep: #0d4a28;
  --red: #cf3520;
  --orange: #e8871e;
  --line: rgba(27, 23, 18, 0.18);
  --display: "Alfa Slab One", "Rockwell", "Georgia", serif;
  --body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --wrap: 68rem;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.55 var(--body);
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; text-underline-offset: 0.18em; }
p { margin: 0 0 1.1em; }
h1, h2, h3 { margin: 0; line-height: 1.1; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.narrow { width: min(100% - 2.5rem, 40rem); margin-inline: auto; }

/* ---------- Hero: the title lands like three dance steps ---------- */
.hero { padding: clamp(1.5rem, 5vw, 4rem) 0 0; overflow: hidden; }
.steps {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(4.6rem, 23vw, 15.5rem);
  line-height: 0.84;
  letter-spacing: -0.015em;
  margin: 0;
}
.steps span { display: block; width: max-content; }
.steps span:nth-child(3n + 1) { color: var(--red); }
.steps span:nth-child(3n + 2) { color: var(--ink); margin-left: 11%; }
.steps span:nth-child(3n + 3) { color: var(--orange); margin-left: 22%; }
.steps.long { font-size: clamp(2.8rem, 11vw, 7rem); line-height: 0.95; }
.steps.long span { display: inline; margin: 0; color: var(--ink); }

@media (prefers-reduced-motion: no-preference) {
  .steps:not(.long) span { animation: step 0.42s cubic-bezier(0.2, 1.4, 0.4, 1) both; }
  .steps span:nth-child(2) { animation-delay: 0.16s; }
  .steps span:nth-child(3) { animation-delay: 0.32s; }
  .steps span:nth-child(4) { animation-delay: 0.48s; }
  @keyframes step {
    from { opacity: 0; transform: translateY(-0.28em) rotate(-3deg); }
    to { opacity: 1; transform: none; }
  }
}

.hero-meta {
  display: grid;
  gap: 0.35rem;
  margin: clamp(1.2rem, 3vw, 2.2rem) 0 clamp(1.6rem, 4vw, 3rem);
  max-width: 34rem;
}
.hero-meta p { margin: 0; }
.hero-sub { font-size: clamp(1.5rem, 4.4vw, 2.5rem); font-weight: 650; line-height: 1.05; letter-spacing: -0.02em; }
.hero-credit { color: var(--ink-soft); font-size: 1.05rem; }

/* The flag's green field carries the facts: when and where. */
.band { background: var(--green); color: #fff; }
.band-inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 1.1rem 2.5rem;
  padding: 1.5rem 0;
}
.band dt { font-size: 0.9rem; opacity: 0.78; }
.band dd { margin: 0.1rem 0 0; font-size: 1.3rem; font-weight: 650; line-height: 1.2; }
.band dd small { display: block; font-size: 0.95rem; font-weight: 400; opacity: 0.85; }
.band dl { margin: 0; }

/* ---------- Page sections ---------- */
.section { padding: clamp(2.2rem, 6vw, 4.5rem) 0; }
.section + .section { padding-top: 0; }
.section-title { font-family: var(--display); font-weight: 400; font-size: clamp(1.9rem, 5vw, 2.8rem); margin-bottom: 1.2rem; }
.about { display: grid; gap: 2rem; grid-template-columns: 1fr; }
.about .copy { max-width: 38rem; font-size: 1.15rem; white-space: pre-line; }
.about img { border: 2px solid var(--ink); width: 100%; max-width: 24rem; }
@media (min-width: 52rem) { .about.has-poster { grid-template-columns: 1.3fr 1fr; align-items: start; } }

/* ---------- Ticket picker ---------- */
.buy { display: grid; gap: 2.5rem; }
@media (min-width: 58rem) { .buy { grid-template-columns: 1.25fr 1fr; align-items: start; } }

.types { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.type {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.4rem 1rem;
  align-items: center;
  padding: 1.1rem 0;
  border-bottom: 2px solid var(--ink);
}
.type-name { font-size: 1.35rem; font-weight: 650; line-height: 1.15; }
.type-note { color: var(--ink-soft); font-size: 0.98rem; }
.type-price { font-family: var(--display); font-size: 1.5rem; }
.type-left { color: var(--red); font-weight: 600; font-size: 0.95rem; }
.type.soldout { color: var(--ink-soft); }
.type.soldout .type-price { text-decoration: line-through; }

.stepper { display: inline-grid; grid-template-columns: 3rem 3rem 3rem; align-items: stretch; border: 2px solid var(--ink); background: var(--card); }
.stepper button {
  font: 600 1.5rem/1 var(--body);
  height: 3rem; border: 0; background: transparent; color: var(--ink); cursor: pointer;
}
.stepper button:hover:not(:disabled) { background: var(--paper-deep); }
.stepper button:disabled { opacity: 0.3; cursor: default; }
.stepper input {
  width: 100%; border: 0; border-inline: 2px solid var(--ink); background: transparent;
  text-align: center; font: 650 1.2rem var(--body); color: var(--ink);
  -moz-appearance: textfield; appearance: textfield;
}
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.panel { background: var(--card); border: 2px solid var(--ink); padding: clamp(1.1rem, 3vw, 1.6rem); }
.field { display: grid; gap: 0.3rem; margin-bottom: 1rem; }
.field label { font-weight: 600; font-size: 0.98rem; }
.field .hint { color: var(--ink-soft); font-size: 0.9rem; }
input[type="text"], input[type="email"], input[type="tel"], input[type="password"], input[type="number"],
input[type="datetime-local"], input[type="search"], input[type="file"], select, textarea {
  width: 100%;
  font: 400 1.05rem/1.3 var(--body);
  color: var(--ink);
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 0;
  padding: 0.7rem 0.8rem;
}
textarea { min-height: 7rem; resize: vertical; }
.total { display: flex; justify-content: space-between; align-items: baseline; padding: 0.9rem 0; border-top: 2px solid var(--ink); margin-top: 0.4rem; }
.total strong { font-family: var(--display); font-weight: 400; font-size: 2rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  font: 650 1.1rem/1.1 var(--body);
  padding: 1rem 1.4rem;
  border: 2px solid var(--ink);
  background: var(--green); color: #fff;
  cursor: pointer; text-decoration: none;
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform 0.08s, box-shadow 0.08s;
}
.btn:hover { background: var(--green-deep); }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn[disabled] { background: var(--paper-deep); color: var(--ink-soft); box-shadow: none; cursor: not-allowed; }
.btn.wide { width: 100%; }
.btn.quiet { background: var(--card); color: var(--ink); box-shadow: none; }
.btn.quiet:hover { background: var(--paper-deep); }
.btn.danger { background: var(--red); }
.btn.small { font-size: 0.92rem; padding: 0.5rem 0.75rem; box-shadow: none; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.notice { border: 2px solid var(--ink); padding: 0.9rem 1rem; background: var(--card); margin-bottom: 1.2rem; }
.notice.error { border-color: var(--red); background: #fbe6e1; }
.notice.ok { border-color: var(--green); background: #e2f0e6; }
.notice.warn { border-color: var(--orange); background: #fcefd9; }
.muted { color: var(--ink-soft); }
.small { font-size: 0.92rem; }

/* ---------- Order and ticket pages ---------- */
.simple-head { padding: 1.4rem 0; border-bottom: 2px solid var(--ink); margin-bottom: clamp(1.5rem, 5vw, 3rem); }
.simple-head a { text-decoration: none; }
.wordmark { font-family: var(--display); font-size: 1.5rem; line-height: 1; }
.wordmark b { font-weight: 400; color: var(--red); }
.wordmark i { font-style: normal; color: var(--orange); }
.page-title { font-family: var(--display); font-weight: 400; font-size: clamp(2.2rem, 7vw, 3.6rem); margin-bottom: 0.8rem; }
.lede { font-size: 1.2rem; max-width: 36rem; }

.summary { width: 100%; border-collapse: collapse; margin: 0 0 1rem; }
.summary td { padding: 0.55rem 0; border-bottom: 1px solid var(--line); }
.summary td:last-child { text-align: right; font-weight: 600; white-space: nowrap; }

.spinner { width: 2.4rem; height: 2.4rem; border: 4px solid var(--paper-deep); border-top-color: var(--green); border-radius: 50%; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.stubs { display: grid; gap: 1.6rem; margin: 2rem 0; }
.stub {
  display: grid;
  grid-template-columns: 1fr;
  background: var(--card);
  border: 2px solid var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
  max-width: 44rem;
}
.stub-main { padding: 1.3rem 1.4rem; display: grid; gap: 0.9rem; align-content: start; }
.stub-top { background: var(--green); color: #fff; padding: 0.6rem 1.4rem; display: flex; justify-content: space-between; gap: 1rem; font-weight: 650; }
.stub-title { font-family: var(--display); font-size: 2.1rem; line-height: 0.95; }
.stub-title b { font-weight: 400; color: var(--red); }
.stub-title i { font-style: normal; color: var(--orange); }
.stub-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 0.7rem 1.2rem; margin: 0; }
.stub-facts dt { font-size: 0.85rem; color: var(--ink-soft); }
.stub-facts dd { margin: 0; font-weight: 600; line-height: 1.25; }
.stub-qr { padding: 1.2rem; display: grid; justify-items: center; gap: 0.6rem; border-top: 2px dashed var(--ink); background: #fff; }
.stub-qr svg, .stub-qr img { width: min(15rem, 62vw); height: auto; }
.stub-code { font: 650 1.15rem/1 var(--body); letter-spacing: 0.12em; }
.stub.used .stub-top { background: var(--ink-soft); }
.stub.dead .stub-top { background: var(--red); }
.stub.dead .stub-qr svg, .stub.dead .stub-qr img { opacity: 0.15; }
@media (min-width: 40rem) {
  .stub { grid-template-columns: 1fr auto; }
  .stub-top { grid-column: 1 / -1; }
  .stub-qr { border-top: 0; border-left: 2px dashed var(--ink); align-content: center; }
  .stub-qr svg, .stub-qr img { width: 12.5rem; }
}

.site-foot { border-top: 2px solid var(--ink); margin-top: clamp(2.5rem, 7vw, 5rem); padding: 1.4rem 0 2.2rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.6rem 2rem; font-size: 0.95rem; color: var(--ink-soft); }

@media print {
  body { background: #fff; }
  .no-print, .site-foot, .simple-head { display: none !important; }
  .stub { box-shadow: none; break-inside: avoid; }
}

/* ---------- Door scanner: built for a phone in a dim foyer ---------- */
body.door { background: #0c1a12; color: #f4efe0; min-height: 100vh; }
.door-top { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.8rem 1rem; }
.door-top form { margin: 0; }
.door-show { font-weight: 650; line-height: 1.2; }
.door-count { font-family: var(--display); font-size: 1.6rem; white-space: nowrap; }
.door-count small { font: 400 0.85rem var(--body); opacity: 0.7; display: block; text-align: right; }
.door-main { width: min(100% - 2rem, 32rem); margin: 0 auto; padding-bottom: 3rem; display: grid; gap: 1rem; }
.viewfinder { position: relative; aspect-ratio: 1; background: #000; border: 2px solid #f4efe0; overflow: hidden; }
.viewfinder video { width: 100%; height: 100%; object-fit: cover; }
.viewfinder .frame { position: absolute; inset: 14%; border: 3px solid rgba(255, 255, 255, 0.8); pointer-events: none; }
.viewfinder .cam-msg { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 1.5rem; }
.verdict { position: absolute; inset: 0; display: none; align-content: center; justify-items: center; text-align: center; padding: 1.2rem; gap: 0.4rem; cursor: pointer; }
.verdict.show { display: grid; }
.verdict h2 { font-family: var(--display); font-weight: 400; font-size: 2.6rem; }
.verdict p { margin: 0; font-size: 1.15rem; font-weight: 600; }
.verdict .who { font-size: 1.5rem; }
.verdict.ok { background: #12853f; color: #fff; }
.verdict.duplicate { background: #e8871e; color: #1b1712; }
.verdict.bad { background: #c92a16; color: #fff; }
body.door input[type="text"], body.door input[type="search"], body.door select { background: #14261b; color: #f4efe0; border-color: #f4efe0; }
body.door .btn { box-shadow: none; border-color: #f4efe0; }
body.door .btn.quiet { background: transparent; color: #f4efe0; }
.door-row { display: grid; grid-template-columns: 1fr auto; gap: 0.5rem; }
.door-label { font-weight: 600; font-size: 0.95rem; margin-bottom: 0.3rem; display: block; }
.found { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.found li { border: 1px solid rgba(244, 239, 224, 0.5); padding: 0.7rem 0.8rem; display: grid; grid-template-columns: 1fr auto; gap: 0.5rem; align-items: center; }
.found .in { color: #f0b35c; font-size: 0.92rem; }

/* ---------- Admin ---------- */
body.admin { background: #f6f3ea; font-size: 1rem; }
.admin-nav { background: var(--ink); color: #fff; }
.admin-nav .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 1.3rem; padding: 0.7rem 0; }
.admin-nav a { color: #fff; text-decoration: none; padding: 0.3rem 0; border-bottom: 3px solid transparent; }
.admin-nav a.on { border-color: var(--orange); }
.admin-nav .brand { font-family: var(--display); font-size: 1.2rem; margin-right: 0.6rem; }
.admin-nav form { margin: 0 0 0 auto; display: flex; gap: 0.6rem; align-items: center; }
.admin-nav button.link { background: none; border: 0; color: #fff; font: inherit; cursor: pointer; text-decoration: underline; }
.admin-nav select { width: auto; padding: 0.3rem 0.5rem; font-size: 0.92rem; }
.admin-main { padding: 1.8rem 0 4rem; }
.admin-main h1 { font-family: var(--display); font-weight: 400; font-size: 2rem; margin-bottom: 1.2rem; }
.admin-main h2 { font-size: 1.25rem; margin: 2rem 0 0.8rem; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 1rem; }
.tile { background: #fff; border: 2px solid var(--ink); padding: 1rem; }
.tile b { display: block; font-family: var(--display); font-weight: 400; font-size: 1.9rem; line-height: 1.1; }
.tile span { color: var(--ink-soft); font-size: 0.92rem; }
.table-scroll { overflow-x: auto; background: #fff; border: 2px solid var(--ink); }
table.data { width: 100%; border-collapse: collapse; font-size: 0.96rem; }
table.data th, table.data td { text-align: left; padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data th { background: var(--paper-deep); font-weight: 650; white-space: nowrap; }
table.data tr:last-child td { border-bottom: 0; }
table.data td.num, table.data th.num { text-align: right; white-space: nowrap; }
.tag { display: inline-block; padding: 0.08rem 0.5rem; font-size: 0.84rem; font-weight: 650; border: 1.5px solid currentColor; }
.tag.paid, .tag.in { color: var(--green); }
.tag.pending { color: #9a5a05; }
.tag.failed, .tag.expired, .tag.refunded, .tag.cancelled { color: var(--red); }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.35rem; }
.checklist li::before { content: "Not yet: "; font-weight: 650; color: var(--red); }
.checklist li.done::before { content: "Done: "; color: var(--green); }
.grid-2 { display: grid; gap: 0 1.2rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.inline-form { display: inline; }
.filters { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 1rem; }
.filters input, .filters select { width: auto; flex: 1 1 12rem; }
.check { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; margin-bottom: 1rem; }
.check input { width: 1.2rem; height: 1.2rem; accent-color: var(--green); }
nav[role="navigation"] { margin-top: 1rem; }
