/* Polymath is licensed and not shipped. Drop the files into public/fonts and these load;
     otherwise the system thin/regular weights stand in, same as the kiosk app. */
@font-face {
  font-family: "Polymath";
  font-weight: 200;
  font-display: swap;
  src:
    local("Polymath Thin"),
    local("Polymath-Thin"),
    url(fonts/Polymath-Thin.woff2) format("woff2"),
    url(fonts/Polymath-Thin.otf) format("opentype");
}
@font-face {
  font-family: "Polymath";
  font-weight: 400;
  font-display: swap;
  src:
    local("Polymath Regular"),
    local("Polymath-Regular"),
    url(fonts/Polymath-Regular.woff2) format("woff2"),
    url(fonts/Polymath-Regular.otf) format("opentype");
}

:root {
  /* THE LIGHT WE LEAVE BEHIND brand guide, 2026 */
  --amber: #ffab33;
  --charcoal: #111111;
  --void: #000000;
  --cream: #f4f0e8;
  --warm-grey: #9c9587;
  --placeholder: #555048;
  --field: rgba(255, 255, 255, 0.05);
  --stroke: rgba(255, 255, 255, 0.14);
  --amber-dim: rgba(255, 171, 51, 0.22);
  --r: 10px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --fade: 320ms ease-in-out;
}
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  background: var(--charcoal);
  color: var(--cream);
  font:
    16px/1.45 "Polymath",
    -apple-system,
    BlinkMacSystemFont,
    "Helvetica Neue",
    system-ui,
    sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  transition: opacity var(--fade);
}
button:active {
  opacity: 0.7;
}
input,
select {
  font: inherit;
  color: var(--cream);
  background: var(--field);
  border: 1px solid var(--stroke);
  border-radius: var(--r);
  padding: 13px 14px;
  outline: none;
  transition: border-color var(--fade);
  -webkit-appearance: none;
  appearance: none;
}
input::placeholder {
  color: var(--placeholder);
}
input:focus,
select:focus {
  border-color: var(--amber);
}
[hidden] {
  display: none !important;
}

/* Type system */
.h1 {
  font-weight: 200;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  line-height: 1.2;
}
.label {
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--warm-grey);
  font-weight: 400;
}
.hint {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--placeholder);
}
.cta {
  display: block;
  width: 100%;
  padding: 19px;
  border-radius: var(--r);
  background: var(--amber);
  color: var(--void);
  text-transform: uppercase;
  letter-spacing: 0.25em;
  font-size: 18px;
  text-align: center;
  transition:
    background-color var(--fade),
    opacity var(--fade);
}
.cta:disabled {
  background: var(--amber-dim);
  color: rgba(0, 0, 0, 0.7);
  opacity: 1;
}
.ghost {
  display: block;
  width: 100%;
  padding: 16px;
  border-radius: var(--r);
  background: var(--field);
  border: 1px solid var(--stroke);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 13px;
  text-align: center;
  color: var(--cream);
}
.ghost.quiet {
  color: var(--warm-grey);
}
.link {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 13px;
  color: var(--amber);
}

/* Logos */
.dot-logo {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--amber);
  display: inline-block;
  flex: none;
}
.orb {
  border-radius: 50%;
  background: radial-gradient(
    circle at center,
    #fdd296 0%,
    var(--amber) 38%,
    rgba(255, 171, 51, 0) 72%
  );
}

/* Fade-only motion */
.fade {
  transition: opacity var(--fade);
}
.fade.out {
  opacity: 0;
  pointer-events: none;
}
@keyframes breathe {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}

/* ---------- Lock ---------- */
#lock {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 32px 24px;
}
#lock form {
  width: min(420px, 100%);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
#lock .h1 {
  font-size: 28px;
  margin: 6px 0 0;
}
#lock .label {
  margin-bottom: 26px;
}
#pin {
  width: 100%;
  text-align: center;
  font-size: 26px;
  letter-spacing: 0.5em;
  padding: 16px;
}
#pin::placeholder {
  letter-spacing: 0.2em;
  font-size: 14px;
}
.err {
  color: var(--warm-grey);
  font-size: 13px;
  letter-spacing: 0.08em;
  min-height: 20px;
}

/* ---------- Register ---------- */
#pos {
  display: none;
  min-height: 100%;
  flex-direction: column;
}
#pos.on {
  display: flex;
}
header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(17, 17, 17, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--stroke);
  padding: calc(12px + var(--safe-t)) 16px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}
header .title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
}
header .title .h1 {
  font-size: 15px;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
@media (max-width: 480px) {
  header .title .h1 {
    font-size: 12px;
    letter-spacing: 0.16em;
  }
}
header .spacer {
  flex: 0 0 0;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 999px;
  background: var(--field);
  border: 1px solid var(--stroke);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--warm-grey);
  max-width: 38vw;
  flex: none;
  text-transform: uppercase;
}
.chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.st {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--placeholder);
  flex: none;
}
.st.online {
  background: var(--amber);
  box-shadow: 0 0 10px rgba(255, 171, 51, 0.6);
}
.st.offline {
  background: var(--placeholder);
}
.iconbtn {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--field);
  border: 1px solid var(--stroke);
  display: grid;
  place-items: center;
  color: var(--warm-grey);
  font-size: 18px;
  line-height: 1;
}
.badge {
  flex: none;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--amber);
  color: var(--amber);
}

main {
  flex: 1;
  padding: 22px 16px calc(124px + var(--safe-b));
  max-width: 860px;
  width: 100%;
  margin: 0 auto;
}
.cat {
  margin: 0 0 26px;
}
.cat .label {
  margin: 0 0 12px;
  display: block;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.item {
  position: relative;
  text-align: left;
  background: var(--field);
  border: 1px solid var(--stroke);
  border-radius: var(--r);
  padding: 16px 14px 14px;
  min-height: 98px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition:
    border-color var(--fade),
    opacity var(--fade);
}
.item .n {
  font-size: 16px;
  line-height: 1.25;
  color: var(--cream);
  padding-right: 30px;
}
.item .p {
  color: var(--warm-grey);
  font-size: 14px;
  letter-spacing: 0.04em;
  margin-top: 10px;
  font-variant-numeric: tabular-nums;
}
.item.in {
  border-color: var(--amber);
}
.item .q {
  position: absolute;
  top: 10px;
  right: 10px;
  min-width: 24px;
  height: 24px;
  border-radius: 12px;
  background: var(--amber);
  color: var(--void);
  font-size: 12px;
  display: grid;
  place-items: center;
  padding: 0 7px;
}
.item .left {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--placeholder);
  margin-top: 6px;
}
.item.low .left {
  color: var(--amber);
}
.item.out {
  opacity: 0.6;
}
.item.out .left {
  color: var(--warm-grey);
}
.sizes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px;
}
.size {
  background: var(--field);
  border: 1px solid var(--stroke);
  border-radius: var(--r);
  padding: 14px 10px;
  text-align: center;
}
.size b {
  display: block;
  font-weight: 400;
  font-size: 18px;
}
.size span {
  display: block;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--placeholder);
  margin-top: 4px;
}
.size.low span {
  color: var(--amber);
}
.size.out {
  opacity: 0.6;
}
.stockrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--stroke);
}
.stockrow .nm {
  flex: 1;
}
.stockrow .nm .sub {
  color: var(--warm-grey);
  font-size: 12px;
  letter-spacing: 0.08em;
}
.item.custom {
  border-style: dashed;
  justify-content: center;
  align-items: center;
}
.item.custom .n {
  color: var(--warm-grey);
  padding: 0;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 12px;
  text-align: center;
}

/* ---------- Total bar ---------- */
#bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 6;
  padding: 14px 16px calc(14px + var(--safe-b));
  background: linear-gradient(
    180deg,
    rgba(17, 17, 17, 0) 0%,
    var(--charcoal) 26%
  );
}
#bar .inner {
  display: flex;
  gap: 10px;
  align-items: stretch;
  max-width: 860px;
  margin: 0 auto;
}
#cartbtn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--field);
  border: 1px solid var(--stroke);
  border-radius: var(--r);
  padding: 14px 16px;
}
#cartbtn .c {
  color: var(--warm-grey);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
#cartbtn .t {
  font-size: 22px;
  font-variant-numeric: tabular-nums;
  color: var(--cream);
}
#charge {
  flex: 0 0 40%;
  width: auto;
  padding: 14px 10px;
  font-size: 15px;
}

/* ---------- Sheets ---------- */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(0, 0, 0, 0.62);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.sheet .card {
  width: 100%;
  max-width: 640px;
  max-height: 88vh;
  overflow: auto;
  background: var(--charcoal);
  border-radius: var(--r) var(--r) 0 0;
  border-top: 1px solid var(--stroke);
  padding: 20px 18px calc(24px + var(--safe-b));
}
.card h3 {
  margin: 0 0 16px;
  font-weight: 400;
  font-size: 13px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--cream);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card h3 button {
  color: var(--warm-grey);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 0;
  border-bottom: 1px solid var(--stroke);
  gap: 12px;
}
.line .nm {
  flex: 1;
  color: var(--cream);
}
.line .sub {
  color: var(--warm-grey);
  font-size: 12px;
  letter-spacing: 0.06em;
  margin-top: 2px;
}
.line .pr {
  color: var(--warm-grey);
  font-variant-numeric: tabular-nums;
}
.stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  overflow: hidden;
  background: var(--field);
}
.stepper button {
  width: 40px;
  height: 36px;
  font-size: 18px;
  color: var(--cream);
}
.stepper b {
  min-width: 28px;
  text-align: center;
  font-weight: 400;
}
.row {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}
.row > * {
  flex: 1;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}
.muted {
  color: var(--placeholder);
  font-size: 13px;
  line-height: 1.5;
}
.pick {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
}
.box {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1.5px solid var(--warm-grey);
  display: grid;
  place-items: center;
  flex: none;
  transition: border-color var(--fade);
}
.box.on {
  border-color: var(--amber);
}
.box.on::after {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--amber);
}

/* ---------- Payment ---------- */
#pay {
  align-items: stretch;
  background: var(--charcoal);
}
#pay .card {
  max-width: none;
  max-height: none;
  height: 100%;
  border: 0;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 28px calc(28px + var(--safe-b));
  transition: background-color 700ms ease-in-out;
}
#pay.ritual .card {
  background: var(--void);
}
#payorb {
  width: 180px;
  height: 180px;
  margin-bottom: 26px;
  transition: opacity var(--fade);
}
#payorb.waiting {
  animation: breathe 3.2s ease-in-out infinite;
}
#payorb.quiet {
  opacity: 0.28;
  animation: none;
}
#payorb.ring {
  background: none;
  border: 1px solid var(--stroke);
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
  color: var(--warm-grey);
  font-size: 30px;
  font-weight: 200;
}
#paykicker.h1 {
  font-size: 22px;
  margin: 0 0 10px;
}
#payamt {
  font-size: 52px;
  font-weight: 200;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  margin: 0 0 14px;
}
#paystatus {
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--warm-grey);
  min-height: 18px;
}
#paysummary {
  color: var(--placeholder);
  font-size: 13px;
  margin-top: 10px;
}
#payfoot {
  width: min(420px, 100%);
  margin-top: 38px;
}
#payfoot .row {
  margin-top: 12px;
}
.testrow {
  margin-top: 26px;
  padding-top: 16px;
  border-top: 1px dashed var(--stroke);
  width: 100%;
}
.testrow .hint {
  margin-bottom: 4px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(112px + var(--safe-b));
  transform: translateX(-50%);
  background: #1c1b18;
  color: var(--cream);
  border: 1px solid var(--stroke);
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: 0.04em;
  z-index: 30;
  max-width: 90vw;
  transition: opacity var(--fade);
}
.sales .tot {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 6px 0 14px;
}
.sales .tot .big {
  font-size: 30px;
  font-weight: 200;
  font-variant-numeric: tabular-nums;
}

/* Mobile interaction and accessibility */
html {
  -webkit-text-size-adjust: 100%;
}
body {
  min-height: 100dvh;
}
button,
.iconbtn,
.stepper button,
.card h3 button {
  min-height: 44px;
  min-width: 44px;
  touch-action: manipulation;
}
button:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
}
button:disabled {
  cursor: default;
}
.hint,
.muted,
#paysummary,
.item .left,
.size span {
  color: var(--warm-grey);
}
input::placeholder {
  color: var(--warm-grey);
}
body.modal-open {
  overflow: hidden;
}
.sheet .card {
  max-height: 90dvh;
  overscroll-behavior: contain;
}
#pay .card {
  min-height: 100%;
  height: auto;
  overflow: auto;
  justify-content: safe center;
  padding-top: calc(24px + var(--safe-t));
}
#connection {
  margin: 0;
  padding: 10px 16px;
  background: var(--field);
  color: var(--amber);
  font-size: 13px;
  text-align: center;
}
.stepper {
  flex-shrink: 0;
}
.line .nm,
.stockrow .nm {
  min-width: 0;
  overflow-wrap: anywhere;
}
#cartbtn {
  min-width: 0;
  gap: 8px;
}
@media (max-width: 380px) {
  header {
    gap: 8px;
    padding-inline: 10px;
  }
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .line {
    flex-wrap: wrap;
  }
  #cartbtn {
    padding: 10px;
  }
  #cartbtn .t {
    font-size: 19px;
  }
}
@media (max-height: 650px) {
  #payorb {
    width: 80px;
    height: 80px;
    margin-bottom: 12px;
    flex-shrink: 0;
  }
  #payfoot {
    margin-top: 18px;
  }
  #payamt {
    font-size: 36px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
/* Keep the full event name readable on phones instead of compressing it to initials. */
@media (max-width: 600px) {
  header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 12px;
  }
  header .title {
    grid-column: 1;
    grid-row: 1;
  }
  header .title .h1 {
    white-space: normal;
    font-size: 12px;
    line-height: 1.5;
    letter-spacing: 0.16em;
  }
  header .badge {
    grid-column: 2;
    grid-row: 1;
  }
  header .spacer {
    display: none;
  }
  header .chip {
    grid-column: 1;
    grid-row: 2;
    justify-self: start;
    max-width: 100%;
  }
  header .iconbtn {
    grid-column: 2;
    grid-row: 2;
    justify-self: end;
  }
}

/* Guest mode shares the payment engine; administrative controls stay server-locked. */
#kioskintro { max-width: 1120px; margin: 56px auto 40px; padding: 0 24px; }
#kioskintro h2 { font-size: clamp(28px, 4vw, 48px); margin: 16px 0; }
#kioskintro p:last-child { color: var(--warm-grey); line-height: 1.7; }
.kiosk-mode { --r: 2px; }
.kiosk-mode #catalog { max-width: 1168px; margin: auto; }
.kiosk-mode .item { min-height: 160px; padding: 24px; }
.kiosk-mode #bar .inner { max-width: 1120px; }
.kiosk-mode #stafffield, .kiosk-mode #readerchip, .kiosk-mode #menubtn { display: none !important; }
#kiosksetup p { line-height: 1.7; margin-bottom: 24px; }
#kioskexit .field { display: flex; flex-direction: column; gap: 12px; margin-bottom: 24px; }
@media (max-width: 600px) {
  #kioskintro { margin: 32px auto 24px; padding: 0 16px; }
  .kiosk-mode .item { min-height: 136px; padding: 18px; }
}
