/* The ticket that becomes the hall: a concert ticket on a black page, its head the sea at night, its paper the
   pale limestone of the amphitheatre. The barcode is ink; the hall it becomes has sea-green rows and your seat in
   the amber of the stage lights. */
:root {
  --page: #000000;          /* the page */
  --head: #0f2c33;          /* the head of the ticket: the sea at night */
  --head-ink: #ede6d8;      /* the words on the head, and the moon */
  --head-muted: #8eb2ae;
  --paper: #ebe5d9;         /* the ticket's paper */
  --bright: #ffffff;        /* the paper with the screen at full brightness, at the door */
  --ink: #141819;           /* the words and the bars of the barcode */
  --muted: #6b7473;         /* the small labels */
  --rows: #2b6a71;          /* the rows of the hall */
  --mine: #e8900c;          /* your seat and the way to it */
  --laser: #ff2414;         /* the scanner's light */
  --ok: #1d8f52;            /* admitted */
}

* {
  box-sizing: border-box;
}

html {
  touch-action: manipulation;
}

html,
body {
  margin: 0;
  overflow-x: clip;
}

body {
  min-height: 100svh;
  background: var(--page);
  color: var(--ink);
  font-family: 'Schibsted Grotesk Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.stage {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
}

.pass {
  --lum: 0;
  position: relative;
  display: grid;
  gap: 16px;
  width: min(340px, 100%);
}

/* the light the bright screen throws round it in the dark (the script sets how much) */
.pass__glow {
  position: absolute;
  inset: 4% -2% 76px;
  border-radius: 40px;
  background: var(--bright);
  filter: blur(34px);
  opacity: 0;
  pointer-events: none;
}

/* ---------------------------------------------------------------- the ticket */
/* the two half-moon notches at the perforation are cut with a mask (the script sets --cut, their height) */
.ticket {
  --cut: 300px;
  --notch: 11px;
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  background: var(--paper);
  background: color-mix(in srgb, var(--paper), var(--bright) calc(var(--lum) * 100%));
  -webkit-mask:
    radial-gradient(circle var(--notch) at 0 var(--cut), #0000 calc(var(--notch) - 0.5px), #000 var(--notch)) 0 0 / 51% 100% no-repeat,
    radial-gradient(circle var(--notch) at 100% var(--cut), #0000 calc(var(--notch) - 0.5px), #000 var(--notch)) 100% 0 / 51% 100% no-repeat;
  mask:
    radial-gradient(circle var(--notch) at 0 var(--cut), #0000 calc(var(--notch) - 0.5px), #000 var(--notch)) 0 0 / 51% 100% no-repeat,
    radial-gradient(circle var(--notch) at 100% var(--cut), #0000 calc(var(--notch) - 0.5px), #000 var(--notch)) 100% 0 / 51% 100% no-repeat;
}

/* ---------------------------------------------------------------- the head */
.head {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  padding: 16px 20px 20px;
  background: var(--head);
  color: var(--head-ink);
}

.head__venue,
.head__date {
  position: relative;
  z-index: 1;
  margin: 0;
  font-size: 13px;
  font-weight: 560;
  letter-spacing: 0.005em;
}

.head__venue {
  display: flex;
  align-items: center;
  gap: 8px;
}

.head__date {
  color: var(--head-muted);
}

.head__mark {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
}

.head__artist {
  position: relative;
  z-index: 1;
  grid-column: 1 / -1;
  max-width: 64%;
  margin: 30px 0 0;
  font-family: 'Imbue Variable', 'Bodoni 72', Didot, serif;
  font-size: 56px;
  font-weight: 500;
  font-optical-sizing: auto;
  line-height: 0.86;
  letter-spacing: -0.012em;
}

.head__tour {
  position: relative;
  z-index: 1;
  grid-column: 1 / -1;
  margin: 8px 0 0;
  color: var(--head-muted);
  font-size: 14px;
  font-weight: 460;
}

.head__sea {
  position: absolute;
  right: 16px;
  bottom: 0;
  width: 120px;
  height: 64px;
  overflow: visible;
}

.head__moon {
  fill: var(--head-ink);
  opacity: 0.9;
}

.head__line,
.head__wave {
  fill: none;
  stroke: var(--head-ink);
  stroke-width: 1.2;
  stroke-linecap: round;
}

.head__line {
  opacity: 0.22;
}

.head__wave {
  opacity: 0.36;
}

/* ---------------------------------------------------------------- the details */
.facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 10px;
  margin: 0;
  padding: 16px 20px 0;
}

.fact dt {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 520;
}

.fact dd {
  min-height: 1.2em;
  margin: 2px 0 0;
  font-size: 17px;
  font-weight: 600;
  white-space: nowrap;
}

.fact--big dd {
  min-height: 1em;
  margin-top: 0;
  font-family: 'Imbue Variable', 'Bodoni 72', Didot, serif;
  font-size: 34px;
  font-weight: 560;
  font-optical-sizing: auto;
  line-height: 1;
}

.holder {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 12px 20px 2px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 480;
}

.holder span:first-child {
  color: var(--ink);
  font-weight: 560;
}

/* the perforation: short slits, the way a tear-off line is cut */
.perf {
  position: relative;
  height: 24px;
}

.perf::before {
  content: '';
  position: absolute;
  left: 18px;
  right: 18px;
  top: 50%;
  height: 1.5px;
  margin-top: -0.75px;
  background: repeating-linear-gradient(90deg, rgba(20, 24, 25, 0.3) 0 6px, transparent 6px 11px);
  background: repeating-linear-gradient(90deg, color-mix(in srgb, var(--ink) 30%, transparent) 0 6px, transparent 6px 11px);
}

/* ---------------------------------------------------------------- the code, or the hall */
.code {
  padding: 0 14px 12px;
}

.note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 20px;
  margin: 0 0 4px;
  font-size: 12.5px;
  font-weight: 560;
  white-space: nowrap;
}

.note__icon {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  flex: none;
}

.note__icon svg {
  width: 16px;
  height: 16px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.note__icon--ok {
  color: var(--ok);
}

.note__icon--mine {
  color: var(--mine);
}

.note__text {
  overflow: hidden;
  text-overflow: ellipsis;
}

.code__box {
  position: relative;
  aspect-ratio: 300 / 156;
}

.code__svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.code__num {
  fill: var(--ink);
  font-size: 12px;
  font-weight: 560;
  letter-spacing: 0.22em;
  font-variant-numeric: tabular-nums;
}

.hall__stage-word {
  fill: var(--paper);
  font-size: 8px;
  font-weight: 640;
  letter-spacing: 0.04em;
}

.hall__wall {
  fill: none;
  stroke: rgba(20, 24, 25, 0.26);
  stroke: color-mix(in srgb, var(--ink) 26%, transparent);
  stroke-width: 1;
}

.hall__door {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hall__door-word {
  fill: var(--ink);
  font-size: 9.5px;
  font-weight: 600;
}

.hall__route {
  fill: none;
  stroke: var(--mine);
  stroke-width: 2;
  stroke-dasharray: 4.5 3.5;
}

/* the scanner's line of light, multiplied over the code: red where the paper is white, nothing on the black bars */
.laser {
  position: absolute;
  left: 6%;
  right: 6%;
  top: calc(43.6% - 12px);
  height: 24px;
  opacity: 0;
  pointer-events: none;
  mix-blend-mode: multiply;
  -webkit-mask: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}

.laser i {
  position: absolute;
  left: 0;
  right: 0;
}

.laser__glow {
  top: 2px;
  height: 20px;
  background: linear-gradient(to bottom, transparent, rgba(255, 36, 20, 0.42) 50%, transparent);
  background: linear-gradient(to bottom, transparent, color-mix(in srgb, var(--laser) 42%, transparent) 50%, transparent);
}

.laser__core {
  top: 11px;
  height: 2px;
  background: var(--laser);
}

/* ---------------------------------------------------------------- the button */
.show {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 56px;
  padding: 0 24px;
  border: 0;
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font: 600 15.5px/1 'Schibsted Grotesk Variable', system-ui, sans-serif;
  letter-spacing: -0.005em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.16s cubic-bezier(0.23, 1, 0.32, 1), background-color 0.25s ease;
}

.show:active {
  transform: scale(0.97);
}

@media (hover: hover) and (pointer: fine) {
  .show:hover {
    background: var(--bright);
  }
}

.show:focus-visible {
  outline: 2px solid var(--paper);
  outline-offset: 4px;
}

.show[aria-disabled='true'] {
  cursor: default;
}

.show[aria-disabled='true']:active {
  transform: none;
}

.show__icon {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  flex: none;
}

.show__icon svg {
  width: 20px;
  height: 20px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.show__label {
  display: inline-block;
  white-space: nowrap;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  .show {
    transition: background-color 0.25s ease;
  }

  .show:active {
    transform: none;
  }
}
