:root {
  --night: #050608;
  --moon: #f1ead8;
  --dim: rgba(241, 234, 216, 0.6);
  --line: rgba(241, 234, 216, 0.18);
  --panel: rgba(5, 6, 8, 0.8);
  --blood: #d11a2a;
  --ok: #3ccf7a;
  --warn: #f2b33d;
  --serif: 'Instrument Serif', Georgia, serif;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  --gutter: 20px;
  --bar-h: 56px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100svh; background: var(--night); color: var(--moon);
  font: 400 15px/1.55 var(--mono); overflow-x: hidden; -webkit-tap-highlight-color: transparent;
}
a { color: inherit; text-underline-offset: 3px; }
button, input { font: inherit; color: inherit; }
img, svg { display: block; max-width: 100%; }
[hidden] { display: none !important; }

/* grain */
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 50; opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* sky: fixed, so the moon stays put while the page scrolls */
.sky { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: -1; }
.star {
  position: absolute; width: 2px; height: 2px; border-radius: 50%; background: var(--moon);
  opacity: .15; animation: twinkle var(--d, 4s) ease-in-out var(--delay, 0s) infinite;
}
.star.big { width: 3px; height: 3px; box-shadow: 0 0 6px rgba(241, 234, 216, .6); }
@keyframes twinkle { 0%, 100% { opacity: .12; } 50% { opacity: var(--peak, .8); } }

.moon {
  position: absolute; width: clamp(240px, 76vmin, 680px); aspect-ratio: 1; border-radius: 50%;
  top: clamp(-120px, -10vmin, -40px); right: clamp(-160px, -16vmin, -60px);
  background:
    radial-gradient(circle at 34% 30%, rgba(120, 108, 86, .28) 0 7%, transparent 10%),
    radial-gradient(circle at 62% 58%, rgba(120, 108, 86, .22) 0 11%, transparent 14%),
    radial-gradient(circle at 46% 74%, rgba(120, 108, 86, .18) 0 5%, transparent 8%),
    radial-gradient(circle at 72% 32%, rgba(120, 108, 86, .16) 0 4%, transparent 7%),
    radial-gradient(circle at 25% 60%, rgba(120, 108, 86, .14) 0 9%, transparent 12%),
    radial-gradient(circle at 40% 35%, #fbf6e8, #e9dfc6 55%, #cbbf9f);
  box-shadow: 0 0 80px 10px rgba(241, 234, 216, .22), 0 0 240px 60px rgba(241, 234, 216, .08);
  animation: rise 2.4s cubic-bezier(.2, .7, .1, 1) both;
  transition: opacity .6s;
}
@keyframes rise { from { transform: translateY(18vh); opacity: 0; } }

/* compact sticky bar, shown once the big title scrolls away */
.bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  display: flex; align-items: center; gap: 14px;
  height: calc(var(--bar-h) + env(safe-area-inset-top)); padding: env(safe-area-inset-top) var(--gutter) 0;
  background: rgba(5, 6, 8, .72); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  transform: translateY(-100%); transition: transform .35s cubic-bezier(.2, .7, .1, 1);
}
.compact .bar { transform: none; }
.bar-brand { display: flex; align-items: baseline; gap: 10px; text-decoration: none; min-width: 0; }
.bar-brand img { width: 56px; height: auto; filter: invert(1); align-self: center; }
.bar-brand span { font: italic 400 26px/1 var(--serif); white-space: nowrap; }
.bar-when { font-size: 12px; color: var(--dim); white-space: nowrap; }
.bar-buy {
  margin-left: auto; padding: 9px 16px; border: 0; background: var(--blood); color: #fff;
  font-size: 13px; font-weight: 500; letter-spacing: .04em; cursor: pointer; white-space: nowrap;
}

main { position: relative; width: min(100% - 2 * var(--gutter), 560px); margin: 0 auto; }

/* hero fills the first screen */
.hero {
  min-height: 100svh; display: flex; flex-direction: column; justify-content: center;
  padding: calc(76px + env(safe-area-inset-top)) 0 32px;
}
.brand {
  position: absolute; top: calc(24px + env(safe-area-inset-top)); left: 0; right: 0;
  display: flex; justify-content: center; mix-blend-mode: difference; pointer-events: none;
}
.logo { width: 84px; height: auto; filter: invert(1); }

h1 {
  font: 400 clamp(92px, 29vw, 200px)/.8 var(--serif); font-style: italic; letter-spacing: -.02em;
  margin: 22px 0 20px; color: var(--moon); mix-blend-mode: difference;
}
.blurb { margin: 0 0 24px; color: var(--dim); max-width: 34ch; }

.facts { margin: 0; border-top: 1px solid var(--line); }
.facts div { display: grid; grid-template-columns: 72px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.facts dt { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); padding-top: 3px; }
.facts dd { margin: 0; font-size: 16px; }

.links { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 14px 0 28px; font-size: 13px; }
.links a, .cal summary {
  display: inline-flex; align-items: center; gap: 8px; min-height: 36px; text-decoration: none; cursor: pointer;
  color: var(--moon); border-bottom: 1px solid transparent;
}
.links a:hover, .cal summary:hover { border-bottom-color: currentColor; }
.links svg { width: 18px; height: 18px; flex: none; }
.cal { position: relative; }
.cal summary { list-style: none; }
.cal summary::-webkit-details-marker { display: none; }
.cal-menu {
  position: absolute; z-index: 10; top: 100%; left: 0; min-width: 220px; margin-top: 6px;
  display: flex; flex-direction: column; background: var(--night); border: 1px solid var(--line);
}
.cal-menu a { padding: 12px 14px; min-height: 0; border-bottom: 1px solid var(--line) !important; }
.cal-menu a:last-child { border-bottom: 0 !important; }
.cal-menu a:hover { background: rgba(241, 234, 216, .08); }

.cta { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.go {
  width: 100%; padding: 17px; border: 0; background: var(--blood); color: #fff; font-size: 15px; font-weight: 500;
  letter-spacing: .04em; cursor: pointer; transition: filter .15s;
}
.go:hover:not(:disabled) { filter: brightness(1.12); }
.go:disabled { opacity: .5; cursor: not-allowed; }
.ghost {
  padding: 17px 18px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; font-size: 14px; white-space: nowrap;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.ghost:hover { border-color: var(--moon); }

/* the form sits on a panel so it stays readable over the fixed moon */
.tickets {
  scroll-margin-top: calc(var(--bar-h) + 16px);
  margin: 0 calc(-1 * var(--gutter)); padding: 24px var(--gutter);
  background: var(--panel); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  animation: reveal .5s cubic-bezier(.2, .7, .1, 1);
}
@keyframes reveal { from { opacity: 0; transform: translateY(16px); } }
h2 { font: 400 34px/1 var(--serif); margin: 0 0 20px; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
h2 span { font: 400 13px/1 var(--mono); color: var(--dim); }

.field { margin-bottom: 14px; }
.field label, .field .lbl { display: block; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); margin-bottom: 6px; }
.field em { font-style: normal; opacity: .7; margin-left: 6px; }
.field input {
  width: 100%; padding: 12px 0; background: transparent; border: 0; border-bottom: 1px solid var(--line);
  border-radius: 0; font-size: 17px; outline: none;
}
.field input:focus { border-bottom-color: var(--moon); }
.field input[aria-invalid="true"] { border-bottom-color: #ff6b6b; }
.field-err { margin: 6px 0 0; color: #ff6b6b; font-size: 13px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.qty { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.qty label { position: relative; }
.qty input { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
.qty span {
  display: grid; place-items: center; height: 52px; border: 1px solid var(--line); font-size: 18px; cursor: pointer;
  transition: background .15s, color .15s;
}
.qty input:checked + span { background: var(--moon); color: var(--night); border-color: var(--moon); }
.qty input:focus-visible + span { outline: 2px solid var(--moon); outline-offset: 2px; }

.pay { margin: 26px 0 14px; padding: 20px 18px; border: 1px solid var(--line); }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; display: grid; gap: 18px; }
.steps li { counter-increment: step; position: relative; padding-left: 40px; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: -2px; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; background: var(--moon); color: var(--night); font-size: 13px; font-weight: 500;
}
.steps p { margin: 0; color: var(--dim); font-size: 13px; }
.steps .step-h { margin-bottom: 4px; color: var(--moon); font-size: 15px; }
.steps strong { color: var(--moon); font-weight: 500; }
.pay-qr { width: 200px; height: 200px; margin: 14px 0 10px; background: #fff; padding: 6px; border-radius: 6px; }
.pay-save {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px;
  border: 1px solid var(--line); text-decoration: none; font-size: 13px;
}
.pay-save:hover { border-color: var(--moon); }

.upload {
  display: block; position: relative; padding: 16px; border: 1px dashed var(--line); text-align: center; cursor: pointer;
  color: var(--dim); margin-bottom: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload.has { border-style: solid; color: var(--moon); }

.err { color: #ff6b6b; margin: 12px 0 0; }
.fine { color: var(--dim); font-size: 12px; margin: 12px 0 0; }
.soldout { font: 400 28px/1.2 var(--serif); margin: 0; }
.done { padding: 8px 0 4px; }
.done-h { font: italic 400 48px/1 var(--serif); margin: 0 0 12px; }

footer { display: flex; gap: 4px; padding: 28px 0 calc(28px + env(safe-area-inset-bottom)); margin-left: -12px; }
footer a {
  display: grid; place-items: center; width: 44px; height: 44px; color: var(--dim); transition: color .15s;
}
footer a:hover { color: var(--moon); }
footer svg { width: 22px; height: 22px; }

@media (min-width: 900px) {
  :root { --gutter: 40px; --bar-h: 64px; }
  main { margin-left: max(var(--gutter), 9vw); }
  .tickets { margin: 32px 0 0; padding: 32px; border: 1px solid var(--line); }
  .moon { width: min(64vw, 760px); top: -8vw; right: -10vw; }
}
@media (max-width: 380px) {
  :root { --gutter: 16px; }
  .bar-when { display: none; }
  .cta { grid-template-columns: 1fr; }
}
@media (max-height: 700px) and (max-width: 899px) {
  h1 { font-size: clamp(80px, 24vw, 140px); margin: 14px 0 14px; }
  .blurb { margin-bottom: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .moon, .star, .tickets { animation: none; }
  .bar { transition: none; }
}

dialog {
  padding: 0; border: 1px solid var(--line); background: var(--night); color: var(--moon);
  width: min(100% - 24px, 520px); max-height: calc(100svh - 24px);
}
dialog::backdrop { background: rgba(0, 0, 0, .72); backdrop-filter: blur(4px); }
.dlg { padding: 20px; }
.dlg-top { display: flex; justify-content: space-between; align-items: center; }
.dlg-top h2 { margin: 0; }
.dlg-top button { background: none; border: 0; font-size: 34px; line-height: 1; cursor: pointer; padding: 0 4px; }
table { width: 100%; border-collapse: collapse; margin-top: 16px; font-size: 14px; }
th { text-align: left; font-weight: 400; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); padding: 0 0 8px; }
td { padding: 9px 0; border-top: 1px solid var(--line); }
td:nth-child(n+2), th:nth-child(n+2) { text-align: right; white-space: nowrap; padding-left: 12px; }
.by-glass { margin-top: 22px; }
.by-glass td:first-child { width: 100%; }
.tag {
  display: inline-block; padding: 1px 6px; margin-right: 4px; border: 1px solid var(--line); border-radius: 3px;
  font-size: 11px; letter-spacing: .04em; color: var(--moon); vertical-align: 1px;
}
.legend { margin: 22px 0 0; padding: 14px; border: 1px solid var(--line); display: grid; gap: 8px; font-size: 13px; }
.legend div { display: grid; grid-template-columns: 48px 1fr; align-items: center; }
.legend dt .tag { margin: 0; }
.legend dd { margin: 0; color: var(--dim); }

/* ticket pages */
.tickets-page h1 { font-size: clamp(72px, 22vw, 120px); margin: 8px 0 16px; mix-blend-mode: normal; }
.tk { margin: 28px 0 0; }
.tk-qr { background: #fff; padding: 12px; max-width: 340px; }
.tk figcaption { margin-top: 8px; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }

/* ops */
.ops, .tickets-page { margin-inline: auto !important; padding: calc(28px + env(safe-area-inset-top)) 0 48px; }
.ops { width: min(100% - 32px, 760px); }
.ops h1 { font-size: 72px; mix-blend-mode: normal; }
.ops-login { max-width: 360px; }
.ops-nav { display: flex; gap: 18px; align-items: center; margin-bottom: 20px; font-size: 14px; }
.ops-nav a { text-decoration: none; color: var(--dim); }
.ops-nav a[aria-current] { color: var(--moon); border-bottom: 1px solid; }
.ops-nav form { margin-left: auto; }
.ops-nav button { background: none; border: 0; color: var(--dim); cursor: pointer; padding: 0; }
.flash { padding: 12px 14px; border: 1px solid var(--line); background: rgba(241, 234, 216, .06); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0 0 18px; }
.stats div { border: 1px solid var(--line); padding: 10px; }
.stats dt { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.stats dd { margin: 4px 0 0; font: 400 34px/1 var(--serif); }
.stats small { font: 12px var(--mono); color: var(--dim); }
.search { display: flex; gap: 8px; margin-bottom: 12px; }
.search input { flex: 1; padding: 10px; background: transparent; border: 1px solid var(--line); }
.search button, .actions button, .actions .btn {
  padding: 10px 14px; border: 1px solid var(--line); background: transparent; cursor: pointer; font-size: 13px; text-decoration: none;
}
.tabs { display: flex; gap: 16px; margin-bottom: 8px; font-size: 13px; text-transform: capitalize; }
.tabs a { color: var(--dim); text-decoration: none; }
.tabs a[aria-current] { color: var(--moon); border-bottom: 1px solid; }
.order { display: grid; grid-template-columns: 96px 1fr; gap: 14px; padding: 16px 0; border-top: 1px solid var(--line); }
.order.rejected { opacity: .5; }
.shot img { width: 96px; height: 160px; object-fit: cover; object-position: top; background: #111; }
.meta p { margin: 0 0 4px; font-size: 13px; word-break: break-word; }
.who strong { font-size: 16px; }
.ref { color: var(--dim); margin-left: 6px; }
.dim { color: var(--dim); }
.bad { color: #ff6b6b; }
.checks { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.checks li { font-size: 12px; padding: 3px 8px; border: 1px solid var(--line); color: var(--dim); }
.checks li.good { color: var(--ok); border-color: rgba(60, 207, 122, .4); }
.checks li.bad { color: #ff6b6b; border-color: rgba(255, 107, 107, .45); }
.btn-line { padding: 10px 14px; border: 1px solid var(--line); background: transparent; cursor: pointer; font-size: 13px; margin: 6px 0 18px; }
.wise td { font-size: 13px; vertical-align: top; }
.wise td:nth-child(2) { text-align: left; white-space: normal; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.actions form { margin: 0; }
.actions .ok { background: var(--moon); color: var(--night); border-color: var(--moon); }
.actions .no { color: #ff8a8a; }

.scan .cam { position: relative; aspect-ratio: 1; background: #000; margin-bottom: 12px; overflow: hidden; }
.scan video { width: 100%; height: 100%; object-fit: cover; }
.reticle { position: absolute; inset: 18%; border: 2px solid rgba(241, 234, 216, .6); }
.result { padding: 20px; margin-bottom: 12px; color: #050608; }
.result.ok { background: var(--ok); }
.result.used { background: var(--warn); }
.result.invalid { background: #ff5a5a; }
.r-head { font: italic 400 48px/1 var(--serif); margin: 0 0 8px; }
.r-body { margin: 0 0 16px; font-size: 16px; }
.result .go { background: #050608; color: var(--moon); }


/* sweat.sg holding page and 404 */
.holding {
  min-height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: calc(32px + env(safe-area-inset-top)) 0 0; margin-inline: auto !important;
}
.holding-logo { width: 140px; height: auto; filter: invert(1); margin-bottom: 8px; }
.holding h1 { font-size: clamp(84px, 22vw, 170px); margin: 18px 0 18px; }
.holding .blurb { margin: 0 auto 28px; }
.holding-cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  width: min(100%, 340px); text-decoration: none;
}
.holding-cta svg { width: 20px; height: 20px; }
.holding-next { margin-top: 22px; font-size: 13px; color: var(--dim); }
.holding-next:hover { color: var(--moon); }
.holding footer { margin: 28px 0 0; justify-content: center; }
