/* The hotel check in button with the scanned passport. Warm paper lit from the upper left with a fine grain, and in
   the middle one pill of night blue lacquer with a brass hairline. Inside, layered in one rounded box (.hc__body, moved
   only by GSAP): the lacquer, the brass light of the success, the light under the pointer, the reflection that crosses
   at the end and the edges on top. Then the row: the well (the passport, the data page that opens and gets scanned,
   the four corners of the scanner, the digital key), the words and the chip with the room number on drums. */
:root {
  --paper: #ece6db;           /* the page behind */
  --paper-light: #fffaf1;     /* the light from the upper left */
  --night: #16203a;           /* the lacquer of the button */
  --night-low: #0d1426;       /* the lacquer in shadow */
  --brass: #d4a75e;           /* the brass: corners, scan, key, chip */
  --brass-hi: #f6dfaa;        /* the brass where it catches the light */
  --brass-deep: #9a7032;      /* the brass in shadow */
  --scan: #fff3d6;            /* the line of light of the scanner */
  --ink: #f6f1e7;             /* the words */
  --muted: rgba(246, 241, 231, 0.56); /* the small line under the words */
  --page-ink: #1d2740;        /* the printed fields of the passport page */
}

* {
  box-sizing: border-box;
}

html {
  touch-action: manipulation;
}

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

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

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

/* the paper: light from the upper left, a soft falloff below, a fine grain */
.stage {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 16px;
  overflow: hidden;
  background:
    radial-gradient(min(80vw, 640px) min(52vh, 380px) at 34% 30%, color-mix(in srgb, var(--paper-light) 90%, transparent), transparent 70%),
    radial-gradient(min(120vw, 900px) min(70vh, 520px) at 50% 122%, rgba(120, 100, 70, 0.2), transparent 70%),
    linear-gradient(180deg, #f1ece3, var(--paper) 60%, #e2dbcf);
}

.stage::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.6;
  background: 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='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.3 0 0 0 0 0.25 0 0 0 0 0.18 0 0 0 0.09 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
}

.hc {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
}

/* the soft shadow the lacquer throws on the paper, long towards the lower right */
.hc__shadow {
  position: absolute;
  left: 50%;
  top: 100%;
  width: 94%;
  height: 28px;
  margin: -20px 0 0 -45%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(20, 26, 44, 0.42), rgba(20, 26, 44, 0.12) 60%, transparent);
  filter: blur(10px);
  pointer-events: none;
}

.hc__btn {
  appearance: none;
  border: 0;
  padding: 0;
  margin: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  border-radius: 999px;
  -webkit-tap-highlight-color: transparent;
}

.hc__btn:focus-visible {
  outline: 2px solid var(--brass-deep);
  outline-offset: 5px;
}

.hc__body {
  --mx: 30%;
  --my: 30%;
  position: relative;
  display: block;
  width: min(88vw, 332px);
  height: 60px;
  border-radius: 999px;
  isolation: isolate;
  box-shadow:
    0 0 0 0.5px rgba(10, 14, 28, 0.5),
    0 1px 1px rgba(10, 14, 28, 0.28),
    0 4px 8px -4px rgba(10, 14, 28, 0.32),
    0 14px 26px -14px rgba(10, 14, 28, 0.48),
    0 32px 54px -30px rgba(40, 30, 10, 0.5);
}

.hc__fill,
.hc__glow,
.hc__shine,
.hc__sweep,
.hc__edge {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  pointer-events: none;
}

/* night blue lacquer: lighter at the top where the paper's light falls, deep at the bottom */
.hc__fill {
  background:
    radial-gradient(120% 160% at 28% -30%, rgba(170, 190, 235, 0.26), transparent 55%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0) 48%, rgba(0, 0, 0, 0.3)),
    linear-gradient(90deg, var(--night), var(--night-low));
}

/* the brass light of the success, anchored to the well (GSAP scales it) */
.hc__glow-light {
  position: absolute;
  left: 30px;
  top: 50%;
  width: 120px;
  height: 120px;
  margin: -60px 0 0 -60px;
  border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--brass) 55%, transparent), color-mix(in srgb, var(--brass-deep) 20%, transparent) 55%, transparent);
  opacity: 0;
}

/* the light under the pointer */
.hc__shine {
  opacity: 0;
  background: radial-gradient(150px 90px at var(--mx) var(--my), rgba(220, 230, 255, 0.18), transparent 70%);
}

/* the reflection that crosses the lacquer at the end */
.hc__sweep-band {
  position: absolute;
  top: -20%;
  left: 0;
  width: 34%;
  height: 140%;
  background: linear-gradient(90deg, transparent, rgba(255, 240, 210, 0.22) 45%, rgba(255, 250, 235, 0.34) 50%, rgba(255, 240, 210, 0.22) 55%, transparent);
}

/* the edges: a brass hairline that catches the light at the top, a dark lip at the bottom */
.hc__edge {
  z-index: 4;
  box-shadow:
    inset 0 1px 0 rgba(255, 232, 190, 0.34),
    inset 0 0 0 1px rgba(214, 167, 94, 0.2),
    inset 0 -1px 0 rgba(0, 0, 0, 0.5),
    inset 0 -12px 16px -12px rgba(0, 0, 0, 0.6);
}

.hc__row {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 9px 0 8px;
  gap: 11px;
}

/* the well: a small dish pressed into the lacquer that holds the passport, opens to its page and ends as the key */
.hc__well {
  position: relative;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 22px;
}

.hc__face,
.hc__brass {
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.hc__face {
  background:
    radial-gradient(100% 100% at 30% 15%, rgba(255, 255, 255, 0.12), transparent 60%),
    linear-gradient(180deg, #0e1528, #1d2a49);
  box-shadow:
    inset 0 1px 2px rgba(0, 0, 0, 0.55),
    inset 0 -1px 0 rgba(255, 232, 190, 0.2),
    0 1px 0 rgba(255, 255, 255, 0.05);
}

.hc__brass {
  opacity: 0;
  background:
    radial-gradient(90% 90% at 32% 18%, rgba(255, 250, 230, 0.85), transparent 55%),
    linear-gradient(160deg, var(--brass-hi), var(--brass) 45%, var(--brass-deep));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    inset 0 -1px 2px rgba(90, 60, 20, 0.5),
    0 2px 6px -2px rgba(0, 0, 0, 0.6),
    0 0 18px -4px color-mix(in srgb, var(--brass) 70%, transparent);
}

.hc__book,
.hc__key {
  position: absolute;
  left: 10px;
  top: 10px;
  width: 24px;
  height: 24px;
  overflow: visible;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hc__book-cover {
  fill: color-mix(in srgb, var(--brass) 14%, transparent);
  stroke: var(--brass);
  stroke-width: 1.4;
}

.hc__book-spine {
  stroke: color-mix(in srgb, var(--brass) 55%, transparent);
  stroke-width: 1;
}

.hc__book-seal,
.hc__book-line {
  stroke: var(--brass-hi);
  stroke-width: 0.9;
}

.hc__key {
  left: 8px;
  top: 8px;
  width: 28px;
  height: 28px;
  opacity: 0;
  stroke: #2a1d08;
  stroke-width: 1.8;
}

.hc__key path,
.hc__key circle {
  stroke-dasharray: 1 1;
}

.hc__arc {
  stroke-width: 1.4;
}

/* the data page of the passport, inside the well */
.hc__card {
  position: absolute;
  inset: 0;
  border-radius: 7px;
  overflow: hidden;
  opacity: 0;
  box-shadow:
    0 0 0 0.5px rgba(70, 50, 20, 0.4),
    0 2px 5px -1px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.hc__page {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hc__paper {
  fill: url(#hc-paper);
}

.hc__guill {
  fill: none;
  stroke: #c9a46a;
  stroke-width: 0.35;
  opacity: 0.55;
}

.hc__sil {
  fill: rgba(40, 52, 78, 0.5);
}

.hc__ghost {
  fill: rgba(29, 39, 64, 0.12);
}

.hc__read {
  fill: var(--page-ink);
}

.hc__read--soft {
  fill: rgba(29, 39, 64, 0.55);
}

.hc__mrz-ghost,
.hc__mrz {
  fill: none;
  stroke-width: 2.2;
  stroke-dasharray: 2.1 1.1;
}

.hc__mrz-ghost {
  stroke: rgba(29, 39, 64, 0.12);
}

.hc__mrz {
  stroke: var(--page-ink);
}

/* the warm light the scanner leaves where it has passed */
.hc__read-tint {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 220, 150, 0.16), rgba(255, 220, 150, 0.06));
  mix-blend-mode: multiply;
  opacity: 0;
}

/* the line of light of the scanner, with a soft trail behind it */
.hc__beam {
  position: absolute;
  left: -2px;
  right: -2px;
  top: 0;
  height: 0;
  opacity: 0;
}

.hc__beam-line {
  position: absolute;
  left: 0;
  right: 0;
  top: -1px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--scan) 18%, #fff 50%, var(--scan) 82%, transparent);
  box-shadow: 0 0 6px 1px color-mix(in srgb, var(--brass) 80%, transparent), 0 0 14px 3px color-mix(in srgb, var(--brass-hi) 45%, transparent);
}

.hc__beam-trail {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 16px;
  background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--brass-hi) 38%, transparent));
}

.hc__beam.is-up .hc__beam-trail {
  bottom: auto;
  top: 0;
  background: linear-gradient(0deg, transparent, color-mix(in srgb, var(--brass-hi) 38%, transparent));
}

/* the four brass corners of the scanner, just outside the open page */
.hc__frame {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  fill: none;
  stroke: var(--brass);
  stroke: var(--brass-deep);
  stroke-width: 1.6;
  stroke-linecap: round;
  opacity: 0;
  filter: drop-shadow(0 0 2px color-mix(in srgb, var(--brass) 55%, transparent));
}

.hc__text {
  flex: 1;
  display: grid;
  min-width: 0;
  text-align: left;
}

.hc__state {
  grid-area: 1 / 1;
  display: grid;
  gap: 2px;
  min-width: 0;
}

.hc__state + .hc__state {
  opacity: 0;
}

.hc__title {
  font-size: 15.5px;
  font-weight: 620;
  font-variation-settings: 'wdth' 96;
  letter-spacing: -0.01em;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hc__title--busy {
  background: linear-gradient(90deg, var(--ink) 0%, var(--ink) 36%, var(--brass) 44%, var(--brass-hi) 50%, var(--brass) 56%, var(--ink) 64%, var(--ink) 100%);
  background-size: 260% 100%;
  background-position: 100% 0;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hc__sub {
  font-size: 11.5px;
  font-weight: 460;
  font-variation-settings: 'wdth' 92;
  color: var(--muted);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hc__lbl {
  color: color-mix(in srgb, var(--brass) 85%, white);
  font-weight: 560;
}

/* the chip with the room number: a little brass-rimmed window that turns to brass when the room is ready */
.hc__chip {
  position: relative;
  flex: none;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 3px;
  width: 58px;
  height: 40px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015));
  box-shadow:
    inset 0 1px 0 rgba(255, 232, 190, 0.16),
    inset 0 0 0 1px rgba(214, 167, 94, 0.22),
    inset 0 -6px 10px -8px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

.hc__chip-glaze {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  background:
    radial-gradient(90% 90% at 30% 10%, rgba(255, 250, 230, 0.7), transparent 55%),
    linear-gradient(160deg, var(--brass-hi), var(--brass) 50%, var(--brass-deep));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), inset 0 -1px 2px rgba(90, 60, 20, 0.5);
}

.hc__chip-lbl {
  position: relative;
  font-size: 8.5px;
  font-weight: 620;
  font-variation-settings: 'wdth' 110;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--brass) 80%, white);
  line-height: 1;
}

.hc__room {
  position: relative;
  display: flex;
  font-size: 15px;
  font-weight: 680;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: var(--ink);
}

.hc__dig {
  position: relative;
  display: block;
  width: 0.64em;
  height: 1.12em;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 22%, #000 78%, transparent);
  mask-image: linear-gradient(180deg, transparent, #000 22%, #000 78%, transparent);
}

.hc__col {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hc__col span {
  display: block;
  height: 1.12em;
  line-height: 1.12em;
}

/* the empty slot before the room is assigned: a short brass bar in every drum */
.hc__slot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0.38em;
  height: 1.5px;
  margin: -0.75px 0 0 -0.19em;
  border-radius: 1px;
  background: color-mix(in srgb, var(--brass) 70%, transparent);
}

.hc.is-ready .hc__chip-lbl {
  color: rgba(42, 29, 8, 0.7);
}

.hc.is-ready .hc__room {
  color: #2a1d08;
}

@media (prefers-reduced-motion: reduce) {
  .hc__beam {
    display: none;
  }
}
