/* ─────────────────────────────────────────────
   BRAND STAMPS — "brands I've worked with",
   rubber stamps on a long strip of ruled paper
   that drifts sideways (drag it, hover to stop).
   Add-on for amandabaruch.com (needs brand-stamps.js)
   ───────────────────────────────────────────── */

.brand-stamps {
  --bs-ink: #2b56a6;
  --bs-paper: #ffffff;
  --bs-rule: rgba(35, 76, 136, .10);
  padding: 30px 0 115px;
  overflow: hidden;
}

/* header laid out sideways: title left, intro right */
.bs-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 340px);
  column-gap: 48px;
  align-items: end;
  max-width: 1120px;
  margin: 0 7vw 56px;
}
.bs-header > * { grid-column: 1; }
.bs-header .section-label { grid-row: 1; }
.bs-header .section-title { grid-row: 2 / span 2; margin: 0; }
.bs-header .section-divider { display: none; }
.bs-header .section-intro { grid-column: 2; grid-row: 2 / span 2; align-self: end; margin: 0; padding-left: 20px; border-left: 2px solid var(--bs-ink); }

/* the paper strip (full width, slightly crooked) */
.bs-strip {
  position: relative;
  margin: 0 -2vw;
  padding: 26px 0 22px;
  background-color: var(--bs-paper);
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 31px, var(--bs-rule) 31px, var(--bs-rule) 32px);
  background-position: 0 12px;
  border-block: 1px solid rgba(35, 76, 136, .10);
  box-shadow: 0 1px 0 #fff inset, 0 26px 44px -34px rgba(23, 44, 70, .55);
  rotate: -1.2deg;
  overflow: hidden;
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}
.bs-strip.is-dragging { cursor: grabbing; }
/* tape holding the strip */
.bs-strip::before,
.bs-strip::after {
  content: '';
  position: absolute;
  z-index: 2;
  top: -8px;
  width: 104px;
  height: 28px;
  background: rgba(213, 230, 155, .78);
  box-shadow: 0 1px 2px rgba(23, 44, 70, .12);
  clip-path: polygon(2% 8%, 98% 0, 100% 92%, 0 100%);
  pointer-events: none;
}
.bs-strip::before { left: 12%; rotate: -4deg; }
.bs-strip::after { right: 14%; rotate: 3deg; }

/* the moving row */
.bs-sheet {
  display: flex;
  align-items: center;
  gap: 34px;
  width: max-content;
  margin: 0;
  padding: 0 17px;
  list-style: none;
  will-change: transform;
}
/* without the script: a row you can scroll sideways */
.brand-stamps:not(.bs-live) .bs-sheet { width: auto; overflow-x: auto; scrollbar-width: none; }

/* one stamp */
.bs-stamp {
  --k: 1;
  flex: none;
  display: grid;
  place-items: center;
  height: 150px;
}
.bs-mark {
  position: relative;
  display: block;
  width: calc(var(--w, 200px) * var(--k));
  aspect-ratio: var(--ar, 1.6);
  color: var(--bs-ink);
  mix-blend-mode: multiply;
  opacity: .93;
  rotate: var(--r, 0deg);
  translate: var(--x, 0) var(--y, 0);
  transition: rotate .35s cubic-bezier(.3, 1.4, .5, 1), scale .2s, opacity .2s;
  pointer-events: none;
}
.bs-stamp:hover .bs-mark { rotate: 0deg; scale: 1.04; opacity: 1; }
.bs-frame { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.bs-logo {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--lw, 66%);
  height: var(--lh, 52%);
  object-fit: contain;
  translate: -50% -50%;
  -webkit-user-drag: none;
}

/* frame shapes: size + logo box */
.bs-stamp[data-shape="circle"]  .bs-mark { --w: 132px; --ar: 1;      --lw: 52%; --lh: 46%; }
.bs-stamp[data-shape="postage"] .bs-mark { --w: 112px; --ar: .857;   --lw: 66%; --lh: 60%; }
.bs-stamp[data-shape="hexagon"] .bs-mark { --w: 174px; --ar: 1.6;    --lw: 62%; --lh: 48%; }
.bs-stamp[data-shape="oval"]    .bs-mark { --w: 174px; --ar: 1.6;    --lw: 64%; --lh: 46%; }
.bs-stamp[data-shape="ticket"]  .bs-mark { --w: 174px; --ar: 1.714;  --lw: 74%; --lh: 54%; }
.bs-stamp[data-shape="rect"]    .bs-mark { --w: 166px; --ar: 1.571;  --lw: 78%; --lh: 56%; }

/* hand-stamped: every one a little crooked */
.bs-stamp:nth-child(12n+1)  .bs-mark { --r: -6deg;  --y: 8px; }
.bs-stamp:nth-child(12n+2)  .bs-mark { --r: 3deg;   --y: -10px; }
.bs-stamp:nth-child(12n+3)  .bs-mark { --r: -2deg;  --y: 4px; }
.bs-stamp:nth-child(12n+4)  .bs-mark { --r: 7deg;   --y: -6px; }
.bs-stamp:nth-child(12n+5)  .bs-mark { --r: 4deg;   --y: 10px; }
.bs-stamp:nth-child(12n+6)  .bs-mark { --r: -5deg;  --y: -8px; }
.bs-stamp:nth-child(12n+7)  .bs-mark { --r: 2deg;   --y: 6px; }
.bs-stamp:nth-child(12n+8)  .bs-mark { --r: -8deg;  --y: -4px; }
.bs-stamp:nth-child(12n+9)  .bs-mark { --r: 5deg;   --y: 8px; }
.bs-stamp:nth-child(12n+10) .bs-mark { --r: -3deg;  --y: -10px; }
.bs-stamp:nth-child(12n+11) .bs-mark { --r: 6deg;   --y: 5px; }
.bs-stamp:nth-child(12n+12) .bs-mark { --r: -4deg;  --y: -6px; }

/* the "thunk" as stamps land the first time the strip shows up */
.bs-live .bs-mark { opacity: 0; }
.bs-live .bs-strip.is-inked .bs-mark {
  opacity: .93;
  animation: bs-thunk 1.1s cubic-bezier(.22, .9, .3, 1) both;
  animation-delay: calc(var(--i, 0) * 90ms);
}
.bs-live .bs-strip.is-inked .bs-stamp:hover .bs-mark { opacity: 1; }
@keyframes bs-thunk {
  0%   { opacity: 0; scale: 1.08; filter: blur(3px); }
  100% { opacity: .93; scale: 1; filter: blur(0); }
}

/* small hint under the strip */
.bs-hint {
  margin: 22px 7vw 0;
  font: 600 10px/1 'Noto Sans', sans-serif;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #556070;
}
.bs-hint span { display: inline-block; margin-left: 8px; animation: bs-nudge 1.8s ease-in-out infinite; }
@keyframes bs-nudge { 0%, 100% { translate: 0; } 50% { translate: 6px; } }

/* ── SMALLER SCREENS ── */
@media (max-width: 760px) {
  .brand-stamps { padding: 16px 0 68px; }
  .bs-header { display: block; margin: 0 24px 40px; }
  .bs-header .section-divider { display: block; }
  .bs-header .section-intro { padding-left: 0; border-left: none; }
  .bs-strip { padding: 18px 0 14px; rotate: -1.6deg; }
  .bs-strip::before, .bs-strip::after { width: 76px; height: 22px; top: -6px; }
  .bs-sheet { gap: 18px; }
  .bs-stamp { --k: .72; height: 116px; }
  .bs-hint { margin: 18px 24px 0; }
}

/* respect "Motion off" and reduced-motion settings */
.motion-paused .bs-live .bs-mark { opacity: .93; animation: none !important; }
.motion-paused .bs-hint span { animation: none; }
@media (prefers-reduced-motion: reduce) {
  .bs-live .bs-mark { opacity: .93; animation: none !important; }
  .bs-mark, .bs-hint span { transition: none; animation: none; }
}
