/* =============================================================================
   COMPONENT: EXPERIENCE: staff pass (current role) + career receipt
   The receipt prints line by line when it scrolls into view (stepped clip).
   ============================================================================= */

/* ---- Current-role card: a staff pass on a strap ------------------------
   Pinned at the top of the strap; the pass pivots on that pin, so it swings
   into place on reveal and sways a little on hover. Only `rotate` moves.
   Numbers count up and the tenure line is filled in by js/components/now-pass.js */
.pass {
  --strap: 62px;
  position: relative;
  max-width: 540px;
  margin-top: var(--strap);
  background: var(--c-paper);
  border: var(--b) solid var(--c-ink);
  border-radius: 16px;
  box-shadow: var(--sh-lg);
  transform-origin: 50% calc(var(--strap) * -1 + 10px);
  transition: rotate 700ms var(--e-back), box-shadow var(--d-mid) var(--e-out);
}

@media (hover: hover) {
  .pass:hover { rotate: 1.6deg; box-shadow: 11px 11px 0 var(--c-ink); }
}

.is-revealed .pass { animation: pass-swing 1.9s backwards; }

@keyframes pass-swing {
  0%   { rotate: 11deg;   animation-timing-function: ease-in-out; }
  26%  { rotate: -6.5deg; animation-timing-function: ease-in-out; }
  48%  { rotate: 3.4deg;  animation-timing-function: ease-in-out; }
  68%  { rotate: -1.6deg; animation-timing-function: ease-in-out; }
  85%  { rotate: 0.6deg;  animation-timing-function: ease-in-out; }
  100% { rotate: 0deg; }
}

/* Strap (mint, stitched), pin on top, metal clip biting the pass */
.pass__strap {
  position: absolute;
  bottom: calc(100% - 12px);
  left: 50%;
  z-index: 2;
  width: 26px;
  height: calc(var(--strap) + 12px);
  translate: -50% 0;
  background:
    repeating-linear-gradient(transparent 0 5px, rgb(22 19 15 / 0.35) 5px 9px) 50% 0 / 2px 100% no-repeat,
    var(--c-mint);
  border-inline: var(--b-thin) solid var(--c-ink);
}

.pass__strap::before,
.pass__strap::after {
  content: "";
  position: absolute;
  left: 50%;
  translate: -50% 0;
  border: var(--b-thin) solid var(--c-ink);
}

.pass__strap::before {           /* the pin */
  top: -12px;
  width: 22px;
  height: 22px;
  background: var(--c-red);
  border-radius: 50%;
  box-shadow: 2px 2px 0 var(--c-ink), inset -3px -3px 0 rgb(0 0 0 / 0.22);
}

.pass__strap::after {            /* the clip */
  bottom: -2px;
  width: 42px;
  height: 20px;
  background: linear-gradient(#ece5d6, #b9b0a1);
  border-radius: 5px;
  box-shadow: inset 0 -5px 0 rgb(22 19 15 / 0.18);
}

.pass__top {
  position: relative;
  padding: 34px clamp(18px, 2.6vw, 26px) clamp(18px, 2.4vw, 24px);
  background-color: var(--c-salmon);
  background-image: radial-gradient(rgb(22 19 15 / 0.12) 1px, transparent 1.3px);
  background-size: 9px 9px;
  border-bottom: var(--b) solid var(--c-ink);
  border-radius: 13px 13px 0 0;
}

.pass__kicker { color: var(--c-ink); }
.pass__kicker > * + *::before { color: var(--c-ink); }

.pass__id {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 14px;
}

.pass__logo {
  flex: none;
  width: 64px;
  height: 64px;
  background: var(--c-paper);
  border: var(--b) solid var(--c-ink);
  border-radius: 10px;
  box-shadow: var(--sh-sm);
  overflow: hidden;
}

.pass__company {
  font: 400 clamp(2.2rem, 1.6rem + 2.2vw, 3.1rem)/0.95 var(--f-display);
  text-transform: uppercase;
  letter-spacing: 0.01em;
}

.pass__role {
  margin-top: 6px;
  font: 700 var(--t-md)/1.2 var(--f-body);
}

.pass__stamp {
  --stamp: var(--c-ink);
  position: absolute;
  top: 12px;
  right: 14px;
  padding: 3px 9px;
  font-size: var(--t-xs);
  rotate: 8deg;
}

/* Three numbers, divided by thin rules */
.pass .pass__stats {   /* .pass prefix beats the ul[class] reset */
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: clamp(16px, 2.2vw, 22px) clamp(18px, 2.6vw, 26px);
  border-bottom: 2px dashed rgb(22 19 15 / 0.3);
}

.pass__stats li {
  padding-inline: 14px;
  font: 700 var(--t-xs)/1.25 var(--f-label);
  color: var(--c-ink-soft);
}

.pass__stats li:first-child { padding-left: 0; }
.pass__stats li + li { border-left: var(--b-thin) solid var(--c-ink); }

.pass__stats b {
  display: block;
  margin-bottom: 4px;
  font: 400 clamp(1.9rem, 1.4rem + 1.5vw, 2.6rem)/1 var(--f-display);
  color: var(--c-ink);
  font-variant-numeric: tabular-nums;
}

.js .pass__stats li { opacity: 0; translate: 0 12px; }
.js .is-revealed .pass__stats li {
  opacity: 1;
  translate: 0 0;
  transition: opacity 500ms var(--e-out), translate 500ms var(--e-out);
  transition-delay: calc(350ms + var(--i, 0) * 120ms);
}

.pass__body { padding: clamp(16px, 2.2vw, 22px) clamp(18px, 2.6vw, 26px) 0; }

.pass__text { font-size: var(--t-base); line-height: 1.55; }

.pass__products { margin-top: 12px; }

.pass__foot {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin: 16px clamp(18px, 2.6vw, 26px) 0;
  padding-block: 12px 16px;
  border-top: 3px double var(--c-ink);
  font: 700 var(--t-xs)/1.3 var(--f-label);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pass__tenure {
  padding-inline: 4px;
  background: linear-gradient(transparent 50%, var(--c-butter) 50% 92%, transparent 92%);
  font: 700 var(--t-sm)/1.3 var(--f-accent);
  letter-spacing: 0;
  text-transform: none;
}

/* ---- Receipt ----------------------------------------------------------- */
.receipt-wrap {
  filter: drop-shadow(6px 6px 0 var(--c-ink));
  rotate: 1.2deg;
}

.receipt {
  --z: 9px;
  padding: 34px clamp(18px, 3vw, 30px) 38px;
  background: var(--c-paper);
  font: 400 var(--t-sm)/1.45 var(--f-label);
  /* Zig-zag tear on top and bottom */
  -webkit-mask:
    conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) top / calc(var(--z) * 2) 51% repeat-x,
    conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / calc(var(--z) * 2) 51% repeat-x;
  mask:
    conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) top / calc(var(--z) * 2) 51% repeat-x,
    conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / calc(var(--z) * 2) 51% repeat-x;
}

.receipt__head {
  padding-bottom: 14px;
  border-bottom: 2px dashed var(--c-ink);
  text-align: center;
}

.receipt__shop {
  font: 400 var(--t-lg)/1 var(--f-display);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.receipt__meta { margin-top: 6px; font-size: var(--t-xs); text-transform: uppercase; }

.receipt__cols,
.receipt__item {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.receipt__cols {
  padding-block: 10px 6px;
  font-size: var(--t-xs);
  font-weight: 700;
  text-transform: uppercase;
}

.receipt__cols span:last-child { text-align: right; }

.receipt__item {
  padding-block: 10px;
  border-top: 2px dotted rgb(22 19 15 / 0.35);
}

.receipt__logo {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: var(--b-thin) solid var(--c-ink);
  border-radius: 6px;
  overflow: hidden;
  background: var(--c-butter);
  font: 400 1rem/1 var(--f-display);
}

.receipt__logo img { width: 100%; height: 100%; object-fit: cover; }

.receipt__role { display: block; font-weight: 700; line-height: 1.25; }
.receipt__company { display: block; font-size: var(--t-xs); color: var(--c-ink-soft); }

.receipt__when {
  font-size: var(--t-xs);
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}

.receipt__more {
  padding-block: 8px 4px;
  border-top: 2px dotted rgb(22 19 15 / 0.35);
  font: 700 var(--t-sm)/1.3 var(--f-accent);
  color: var(--c-ink-soft);
}

.receipt__total {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
  padding-block: 12px;
  border-block: 3px double var(--c-ink);
  font: 400 var(--t-md)/1 var(--f-display);
  text-transform: uppercase;
}

.receipt__paid { margin-top: 12px; font-size: var(--t-xs); text-transform: uppercase; }

.receipt__barcode {
  height: 46px;
  margin: 16px auto 8px;
  max-width: 260px;
  background: repeating-linear-gradient(90deg,
    var(--c-ink) 0 2px, transparent 2px 4px, var(--c-ink) 4px 7px, transparent 7px 9px,
    var(--c-ink) 9px 10px, transparent 10px 13px, var(--c-ink) 13px 16px, transparent 16px 18px);
}

.receipt__thanks { text-align: center; font-weight: 700; }

/* Print animation: the paper feeds out in steps, like a till roll.
   The clip sits on the inner .receipt: clipping the observed wrapper itself
   would hide it from IntersectionObserver and it would never reveal. */
.js .receipt-wrap[data-reveal] { opacity: 1; transform: none; }

.js .receipt-wrap[data-reveal] .receipt {
  clip-path: inset(0 0 100% 0);
  transition: clip-path 1.5s steps(16, end);
}

.js .receipt-wrap[data-reveal].is-revealed .receipt { clip-path: inset(0); }

@media (max-width: 480px) {
  .receipt__cols, .receipt__item { grid-template-columns: 32px minmax(0, 1fr); }
  .receipt__cols span:last-child { display: none; }
  .receipt__when { grid-column: 2; text-align: left; margin-top: -6px; }
  .pass__stats li { padding-inline: 8px; }
  .pass__stats li:first-child { padding-left: 0; }
}
