:root {
  --fondo: #ffffff;
  --testo: #18181b;
  --testo-2: #71717a;
  --testo-3: #a1a1aa;
  --bordo: rgba(17, 17, 19, 0.1);
  --tasto: #111113;
  --tasto-alto: #2a2a2f;
  --tasca: #3a3a40;
  --tasca-fondo: #050506;
  --accento: #2f6bff;
  --accento-tenue: #eaf0ff;
  --carta: #ffffff;
  --focus: #2f6bff;

  /* sizes: measured on width and height, so the unit fits a phone box too */
  --bw: clamp(232px, min(64vw, 46vh), 280px);
  --bh: 56px;
  --pw: calc(var(--bw) - 30px);
  --ph: calc(var(--pw) * 0.6);
  --gap: 18px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  background: var(--fondo);
  color: var(--testo);
  font-family: "Mona Sans Variable", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

.stage {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 16px;
}

/* the unit: room for the pass above, the button, the small note below */
.unit {
  position: relative;
  width: var(--bw);
  display: grid;
  grid-template-rows: calc(var(--ph) + var(--gap)) var(--bh) auto;
  justify-items: center;
}

/* the pocket: everything above the button and down to its bottom edge; what falls below is cut away */
.pocket {
  position: absolute;
  left: -28px;
  right: -28px;
  top: -24px;
  height: calc(var(--ph) + var(--gap) + var(--bh) + 24px);
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}

/* the inside of the pocket: a darker copy of the button behind it, that rises to show the slot */
.lip {
  position: absolute;
  left: 28px;
  right: 28px;
  bottom: 0;
  height: var(--bh);
  border-radius: 16px;
  background:
    linear-gradient(180deg, var(--tasca-fondo) 0 3px, var(--tasca) 3px 5px, var(--tasto-alto) 14px, var(--tasto) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* the boarding pass */
.pass {
  position: absolute;
  left: 50%;
  bottom: calc(var(--bh) + var(--gap));
  width: var(--pw);
  height: var(--ph);
  margin-left: calc(var(--pw) / -2);
  background: var(--carta);
  border-radius: 12px;
  box-shadow: 0 0 0 1px var(--bordo), 0 1px 2px rgba(17, 17, 19, 0.05), 0 16px 28px -18px rgba(17, 17, 19, 0.45);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto auto auto;
  font-size: calc(var(--pw) * 0.042);
  color: var(--testo);
  will-change: transform;
}
.pass__band {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 2.3em;
  padding: 0 1.1em;
  background: var(--accento);
  color: #fff;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.pass__air { font-variation-settings: "wdth" 112; font-weight: 700; }
.pass__kind { opacity: 0.78; font-weight: 500; }
.pass__route {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.6em;
  padding: 0 1.1em;
}
.pass__code {
  font-size: 2.6em;
  font-weight: 700;
  font-variation-settings: "wdth" 100;
  letter-spacing: -0.02em;
  line-height: 1;
}
.pass__plane { width: 100%; height: 1em; overflow: visible; }
.pass__dash { fill: none; stroke: var(--testo-3); stroke-width: 1; stroke-dasharray: 2 3; }
.pass__jet { fill: none; stroke: var(--accento); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.pass__meta {
  display: grid;
  grid-template-columns: repeat(4, auto);
  justify-content: space-between;
  padding: 0 1.1em 0.7em;
}
.pass__meta span { display: grid; gap: 0.15em; }
.pass__meta em { font-style: normal; color: var(--testo-2); font-size: 0.86em; }
.pass__meta b { font-weight: 650; }
.pass__perf {
  height: 1px;
  margin: 0 0.6em;
  background-image: linear-gradient(90deg, var(--bordo) 0 3px, transparent 3px 6px);
  background-size: 6px 1px;
}
.pass__bars {
  height: 2.4em;
  margin: 0.55em 1.1em 0.6em;
  background-repeat: no-repeat;
  opacity: 0.85;
}

/* the button: the face sits in front of the pocket */
.btn {
  grid-row: 2;
  position: relative;
  z-index: 2;
  width: var(--bw);
  height: var(--bh);
  border: 0;
  padding: 0;
  background: none;
  font: inherit;
  color: #fff;
  cursor: pointer;
  border-radius: 16px;
  outline: none;
  -webkit-user-select: none;
  user-select: none;
}
.btn:focus-visible { box-shadow: 0 0 0 3px var(--fondo), 0 0 0 5px var(--focus); }
.btn__face {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border-radius: 16px;
  background: linear-gradient(180deg, var(--tasto-alto), var(--tasto) 55%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 1px 2px rgba(17, 17, 19, 0.2),
    0 12px 24px -14px rgba(17, 17, 19, 0.6);
  transform-origin: 50% 100%;
}
.btn__shine {
  position: absolute;
  left: 14px;
  right: 14px;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  opacity: 0.6;
}

.wallet { position: relative; width: 24px; height: 24px; flex: none; }
.wallet svg { width: 24px; height: 24px; overflow: visible; }
.wallet__card { fill: none; stroke: rgba(255, 255, 255, 0.55); stroke-width: 1.4; }
.wallet__card--a { stroke: var(--accento); fill: var(--tasto); }
.wallet__body { fill: var(--tasto); stroke: #fff; stroke-width: 1.5; stroke-linejoin: round; }
.wallet__flap { fill: none; stroke: #fff; stroke-width: 1.4; }
.wallet__count {
  position: absolute;
  right: -9px;
  top: -7px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--accento);
  box-shadow: 0 0 0 2px var(--tasto);
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  overflow: hidden;
}
.wallet__count span { display: block; }

.btn__labels { position: relative; display: grid; font-size: 16px; font-weight: 600; letter-spacing: 0.005em; }
.btn__label {
  grid-area: 1 / 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.tick { width: 16px; height: 16px; }
.tick path { fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.note {
  grid-row: 3;
  display: grid;
  margin-top: 14px;
  font-size: 13px;
  color: var(--testo-2);
}
.note span { grid-area: 1 / 1; text-align: center; }

/* the drawn pointer of the autopilot */
.ghost {
  position: fixed;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  margin: -3px 0 0 -4px;
  pointer-events: none;
  z-index: 5;
  opacity: 0;
  visibility: hidden;
  filter: drop-shadow(0 2px 3px rgba(17, 17, 19, 0.25));
}
.ghost path { fill: #111113; stroke: #fff; stroke-width: 1.4; stroke-linejoin: round; }

@media (max-height: 520px) {
  :root { --gap: 12px; }
  .note { margin-top: 10px; }
}
