/* The boarding pass of Aurel Air, a made-up airline: one pass alone on white, a single teal accent. */
:root {
  --fondo: #ffffff;
  --carta: #ffffff;
  --bordo: #e6e4df;
  --tinta: #f4f2ee;
  --testo: #15140f;
  --testo-2: #5e5a52;
  --testo-3: #9d988d;
  --accento: #0e7c6b;          /* the single accent: the arc, the plane, the gate change, Saved */
  --accento-chiaro: #e3f1ee;
  --scuro: #15140f;            /* the pill */
  --ombra: 28, 24, 18;
  --tacca: 0.72em;             /* the radius of the notches on the perforation */
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
html { font-size: clamp(9px, min(4.1vw, 2.8vh), 19px); }
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;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.mono { font-family: "JetBrains Mono Variable", ui-monospace, monospace; font-variant-numeric: tabular-nums; }

.stage { height: 100vh; display: grid; place-items: center; padding: 2vh 4vw; }

/* the pass: two pieces, the soft shadow follows the notches because it is a drop-shadow on the wrapper */
.pass {
  position: relative;
  width: min(20em, 92vw);
  filter: drop-shadow(0 0.1em 0.12em rgba(var(--ombra), 0.08)) drop-shadow(0 0.9em 1.6em rgba(var(--ombra), 0.11));
}
.main, .stub {
  position: relative;
  /* two half backgrounds, each with a transparent circle at its corner: the notches of the perforation */
  background:
    radial-gradient(circle at 0 var(--ty), transparent var(--tacca), var(--carta) calc(var(--tacca) + 0.6px)) left / 51% 100% no-repeat,
    radial-gradient(circle at 100% var(--ty), transparent var(--tacca), var(--carta) calc(var(--tacca) + 0.6px)) right / 51% 100% no-repeat;
}
.main { --ty: 100%; border-radius: 1.3em 1.3em 0 0; padding: 1.1em 1.2em 0.9em; }
.stub {
  --ty: 0%;
  border-radius: 0 0 1.3em 1.3em;
  padding: 1em 1.2em 1.1em;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1em;
  align-items: center;
  cursor: pointer;
  transform-origin: 100% 0%;
  outline: none;
}
/* the perforation: a dashed line between the notches */
.stub::before {
  content: "";
  position: absolute;
  left: calc(var(--tacca) + 0.35em);
  right: calc(var(--tacca) + 0.35em);
  top: -1px;
  border-top: 2px dashed var(--bordo);
}
.stub:focus-visible { box-shadow: inset 0 0 0 2px var(--accento); }

/* head */
.head { display: flex; align-items: center; justify-content: space-between; gap: 1em; }
.brand { display: inline-flex; align-items: center; gap: 0.4em; font-weight: 640; font-size: 0.86em; letter-spacing: -0.005em; }
.brand__mark { width: 1.25em; height: 1.25em; fill: none; stroke: var(--accento); stroke-width: 2.4; stroke-linecap: round; }
.head__label { font-size: 0.7em; letter-spacing: 0.08em; text-transform: uppercase; color: var(--testo-3); font-weight: 560; }

/* route */
.route {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: end;
  gap: 0.5em;
  margin-top: 1em;
}
.port { display: grid; gap: 0.15em; }
.port--to { text-align: right; }
.port__code {
  font-size: 2.3em;
  line-height: 0.95;
  font-weight: 720;
  font-variation-settings: "wdth" 88;
  letter-spacing: -0.02em;
}
.port__city { font-size: 0.66em; color: var(--testo-2); white-space: nowrap; }
.arc { width: 100%; height: auto; overflow: visible; margin-bottom: 0.9em; }
.arc__base { fill: none; stroke: #cdc8be; stroke-width: 1.7; stroke-dasharray: 2.4 3.4; stroke-linecap: round; }
.arc__done { fill: none; stroke: var(--accento); stroke-width: 2; stroke-linecap: round; stroke-dasharray: 1 1; stroke-dashoffset: 1; }
.arc__end { fill: var(--carta); stroke: var(--testo-3); stroke-width: 1.4; }
.plane { fill: var(--accento); }

/* details */
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75em 0.8em;
  margin-top: 1.1em;
  padding-top: 0.9em;
  border-top: 1px solid var(--bordo);
}
.grid dt { font-size: 0.62em; letter-spacing: 0.07em; text-transform: uppercase; color: var(--testo-3); font-weight: 560; }
.grid dd { font-size: 0.95em; font-weight: 600; margin-top: 0.2em; white-space: nowrap; }
.gate { color: var(--testo); transition: color 0.4s; }
.gate.is-new { color: var(--accento); }

/* the rolling characters: each one a window over its column */
.roll { display: inline-flex; }
.roll__c { position: relative; display: inline-block; overflow: hidden; height: 1.2em; line-height: 1.2em; vertical-align: bottom; }
.roll__c > span { display: block; }
.roll__c > span + span { position: absolute; left: 0; top: 0; }

/* status line: two faces in the same box, the box never changes height */
.status {
  position: relative;
  margin-top: 0.95em;
  height: 2.3em;
  border-radius: 0.8em;
  background: var(--tinta);
  overflow: hidden;
  font-size: 0.8em;
}
.status__flash { position: absolute; inset: 0; background: var(--accento-chiaro); opacity: 0; }
.status__face {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  gap: 0.55em;
  padding: 0 0.9em;
  white-space: nowrap;
  color: var(--testo-2);
}
.status__face b { color: var(--testo); font-weight: 650; }
.status__face[data-sface="gate"] { visibility: hidden; color: var(--testo); }
.status__face[data-sface="gate"] b { color: var(--accento); }
.status__face s { color: var(--testo-3); text-decoration-thickness: 1.5px; margin-left: 0.25em; }
.status .ico { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.status__face[data-sface="gate"] .ico { stroke: var(--accento); }
.to { width: 1em; height: 0.65em; fill: none; stroke: var(--testo-3); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; margin: 0 0.15em; }

/* stub */
.qr { width: 5em; height: 5em; display: block; }
.qr rect { fill: var(--testo); }
.stub__side { display: grid; gap: 0.3em; justify-items: start; min-width: 0; }
.stub__line { font-size: 0.8em; font-weight: 600; white-space: nowrap; }
.stub__note { font-size: 0.68em; color: var(--testo-3); }

/* the pill: two faces centred on top of each other, out of the flow, so the wider one never shifts the other */
.pill {
  position: relative;
  margin-top: 0.35em;
  width: 100%;
  height: 2.4em;
  border-radius: 99em;
  color: #fff;
  font-size: 0.82em;
  font-weight: 600;
  font-variation-settings: "wdth" 100;
  isolation: isolate;
}
.pill__bg { position: absolute; inset: 0; border-radius: inherit; background: var(--scuro); z-index: -1; }
.pill__face {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45em;
  white-space: nowrap;
}
.pill__face[data-face="saved"] { visibility: hidden; }
.pill .ico { width: 1.2em; height: 1.2em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tick { stroke-dasharray: 1 1; stroke-dashoffset: 1; }
@media (hover: hover) {
  .pill:hover .pill__face { font-variation-settings: "wdth" 112; }
  .pill__face { transition: font-variation-settings 0.35s cubic-bezier(.3,1.6,.5,1); }
}
