/* KNC Pulls flair layer. Load after site.css.
   Adds: hero offer card (foil), "what I buy" band, rolling numbers, bounty board,
   section entrances, button sheen, gold closing field.
   Every animation sits inside prefers-reduced-motion: no-preference, and site.css
   already switches motion off for visitors who ask for that. No JS = finished static page. */

:root {
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-expo: cubic-bezier(.16, 1, .3, 1);
}

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

/* ---------- Offer card (homepage hero) ---------- */
@property --rx { syntax: '<angle>'; inherits: true; initial-value: 0deg; }
@property --ry { syntax: '<angle>'; inherits: true; initial-value: 0deg; }
@property --mx { syntax: '<percentage>'; inherits: true; initial-value: 50%; }
@property --my { syntax: '<percentage>'; inherits: true; initial-value: 30%; }

.card-stage { perspective: 1000px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.foil-card {
  --tx: 0px; --ty: 0px;
  position: relative; display: block; width: min(300px, 70vw); aspect-ratio: 5 / 7;
  border: 0; padding: 0; background: none; border-radius: 16px; cursor: pointer;
  color: var(--text); font-family: var(--sans); text-align: left;
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform .6s var(--ease-out);
  touch-action: pan-y; -webkit-tap-highlight-color: transparent;
}
.foil-card.is-live { transition: transform .08s linear; }
.foil-card:focus-visible { outline-offset: 6px; border-radius: 16px; }
.fc-inner {
  position: absolute; inset: 0; display: block; border-radius: inherit; overflow: hidden;
  background: #0e0e14; container-type: inline-size;
  box-shadow: 0 34px 60px -24px rgba(0, 0, 0, .9), 0 24px 80px -30px rgba(240, 180, 41, .35);
}
/* gold frame */
.fc-inner::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 2cqw;
  background: linear-gradient(135deg, #ffe9a3, #f0b429 22%, #a8710d 45%, #ffe08a 62%, #c98f14 80%, #f7d774);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.fc-face {
  position: absolute; inset: 2cqw; border-radius: 3.6cqw; background: var(--bg);
  display: flex; flex-direction: column; padding: 4.6cqw 4.6cqw 4cqw; overflow: hidden;
}
.fc-face[hidden] { display: none; }
.fc-top, .fc-foot { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.fc-brand { font-family: var(--display); font-size: 7.4cqw; line-height: 1; letter-spacing: .04em; }
.fc-kind, .fc-foot, .fc-upto {
  font-size: 3.5cqw; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3);
}
.fc-kind { color: var(--gold); }
.fc-art {
  position: relative; flex: 1; min-height: 0; margin-top: 3cqw; border-radius: 2.4cqw; overflow: hidden;
  background:
    repeating-conic-gradient(from 0deg at 50% 62%, rgba(240, 180, 41, .13) 0 5deg, rgba(240, 180, 41, 0) 5deg 13deg),
    var(--surface-2);
}
/* logo.png has empty space around the mascot, so it is scaled up and pushed down to fill the window */
.fc-art img {
  position: absolute; left: 50%; bottom: -27%; height: 145%; width: auto; max-width: none;
  transform: translate(calc(-50% + var(--tx)), var(--ty)); transition: transform .6s var(--ease-out);
}
.foil-card.is-live .fc-art img { transition: none; }
.fc-rate { display: flex; align-items: baseline; gap: 2.4cqw; margin-top: 4cqw; font-family: var(--display); font-size: 27cqw; line-height: .82; color: var(--gold); }
.fc-rate b { font-weight: 400; font-size: 11cqw; color: var(--text); }
.fc-upto { align-self: flex-start; padding-top: 1.6cqw; }
.fc-line { font-size: 4.5cqw; line-height: 1.3; color: var(--text-2); margin-top: 2.2cqw; }
.fc-foot { margin-top: 3cqw; padding-top: 2.6cqw; border-top: 1px solid var(--line); }

.fc-pay { display: flex; flex-direction: column; justify-content: space-evenly; flex: 1; }
.fc-pay > span { display: block; }
.fc-pay b { display: block; font-family: var(--display); font-weight: 400; font-size: 12.5cqw; line-height: .95; color: var(--gold); }
.fc-pay i { display: block; font-style: normal; font-size: 4.6cqw; line-height: 1.35; color: var(--text-2); margin-top: 1cqw; }

/* foil: a narrow holo streak that follows the pointer */
.fc-foil, .fc-sheen, .fc-glare { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; }
.fc-foil {
  mix-blend-mode: color-dodge; opacity: .5;
  background: linear-gradient(112deg,
    rgba(255, 214, 102, 0) 46.5%, rgba(255, 214, 102, .42) 48.2%, rgba(130, 225, 255, .26) 49.6%,
    rgba(255, 150, 225, .22) 51%, rgba(255, 214, 102, .38) 52.2%, rgba(255, 214, 102, 0) 54%);
  background-size: 300% 300%; background-position: var(--mx) var(--my);
}
.fc-sheen {
  mix-blend-mode: screen; opacity: .05;
  background: linear-gradient(112deg, transparent 47%, #ffd666 48.6%, #82e1ff 50%, #ff96e1 51.4%, transparent 53%);
  background-size: 300% 300%; background-position: var(--mx) var(--my);
}
.fc-glare {
  mix-blend-mode: soft-light;
  background: radial-gradient(circle at var(--mx) var(--my), rgba(255, 255, 255, .4), rgba(255, 255, 255, 0) 36%);
}
.card-hint { font-size: 14px; color: var(--text-3); }

/* ---------- "What I buy" band ---------- */
.band { border-block: 1px solid var(--line); overflow: hidden; padding: 16px 0 12px; }
.band-track { display: flex; width: max-content; }
.band-set { display: flex; align-items: center; flex-shrink: 0; font-family: var(--display); font-size: clamp(36px, 7vw, 64px); line-height: 1; letter-spacing: .01em; white-space: nowrap; }
.band-set span { padding: 0 .32em; }
.band-set i { display: block; width: .24em; height: .34em; border-radius: .04em; background: var(--gold); transform: rotate(8deg) translateY(-.04em); }

/* ---------- Rolling numbers ---------- */
.roll__digits { display: inline-flex; font-variant-numeric: tabular-nums; line-height: 1; vertical-align: bottom; }
.roll__col { display: inline-block; height: 1em; overflow: clip; }
.roll__strip { display: flex; flex-direction: column; transform: translateY(calc(var(--d) * -1em)); }
.roll__strip > span { height: 1em; line-height: 1; }

/* ---------- Bounty board (rows come from bounties.js) ---------- */
.bounty { list-style: none; display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.bounty li { background: var(--surface); display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px 16px; padding: 16px; }
.bounty-card { min-width: 0; }
.bounty-name { font-size: 17px; font-weight: 600; line-height: 1.3; }
.bounty-meta { font-size: 14px; color: var(--text-3); margin-top: 2px; }
.bounty-pay { text-align: right; font-family: var(--display); font-size: 44px; line-height: .9; color: var(--gold); font-variant-numeric: tabular-nums; }
.bounty-pay small { display: block; font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); margin-bottom: 6px; }
.bounty .btn { grid-column: 1 / -1; }
.bounty-updated { margin-bottom: 10px; }
.bounty-note { margin-top: 12px; }
@media (min-width: 720px) {
  .bounty li { grid-template-columns: minmax(0, 1fr) 150px 150px; padding: 16px 20px; }
  .bounty .btn { grid-column: auto; }
}

/* ---------- Gold closing field ---------- */
.section.cta-field { background: var(--gold); color: var(--gold-ink); border-top: 0; }
.cta-grid { display: grid; gap: 24px; align-items: end; }
.cta-field p { font-size: 18px; max-width: 26em; }
.cta-side { display: flex; flex-direction: column; align-items: flex-start; gap: 20px; }
.btn-ink { background: var(--gold-ink); color: var(--gold); }
.btn-ink:hover { background: #000; }
.cta-field :focus-visible { outline-color: var(--gold-ink); }
.cta-field + .footer { margin-top: 0; border-top: 0; }
@media (min-width: 860px) { .cta-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: 56px; } }

/* ---------- Buttons (every page) ---------- */
.btn { transition: background .15s ease-out, border-color .15s ease-out, color .15s ease-out, transform .14s var(--ease-out); }
.btn:active { transform: scale(.98); }
.btn-primary { position: relative; overflow: hidden; }
.btn-primary::after {
  content: ''; position: absolute; top: -20%; bottom: -20%; left: -45%; width: 34%; opacity: 0; pointer-events: none;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, .6), rgba(255, 255, 255, 0));
  transform: skewX(-18deg);
}

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  /* page load: the headline rises into place (every page), the card is dealt in (homepage) */
  h1.h1 { animation: h1-rise .9s var(--ease-expo) both; }
  .hero-copy > :not(.h1) { animation: fade-up .7s var(--ease-out) .18s both; }
  .card-stage { animation: deal 1.2s var(--ease-expo) .1s both; }

  /* the card catches light on its own until the visitor takes over */
  .foil-card.is-idle { animation: sway 7s ease-in-out infinite alternate; }
  .is-off .foil-card.is-idle, .band.is-off .band-track { animation-play-state: paused; }

  .band-track { animation: band 40s linear infinite; }
  .band:hover .band-track { animation-play-state: paused; }

  @media (hover: hover) { .btn-primary:hover::after { animation: sheen .7s var(--ease-out); } }

  /* section entrances, fired once by flair.js. Only hidden when flair.js is running. */
  .fx [data-in] { opacity: 0; transform: translateY(22px); transition: opacity .6s ease, transform .8s var(--ease-expo); transition-delay: calc(var(--i, 0) * 70ms); }
  .fx [data-in="flap"] { transform: perspective(700px) rotateX(-80deg); transform-origin: 50% 0; }
  .fx [data-in].is-in { opacity: 1; transform: none; }
  .fx [data-in="flap"].is-in { transform: perspective(700px) rotateX(0deg); }

  .roll:not(.is-in) .roll__strip { transform: none; }
  .roll.is-in .roll__strip { transition: transform 1.1s var(--ease-expo) calc(var(--i) * 70ms + var(--roll-delay, 0ms)); }
}

@keyframes h1-rise { from { clip-path: inset(0 0 100% 0); transform: translateY(.4em); } to { clip-path: inset(0 0 -20% 0); transform: none; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes deal { from { opacity: 0; transform: translateY(36px) rotate(7deg); } to { opacity: 1; transform: none; } }
@keyframes sway {
  from { --rx: 3deg; --ry: -11deg; --mx: 18%; --my: 22%; }
  to { --rx: -2deg; --ry: 11deg; --mx: 82%; --my: 64%; }
}
@keyframes band { to { transform: translateX(-50%); } }
@keyframes sheen { from { opacity: 1; transform: translateX(0) skewX(-18deg); } to { opacity: 1; transform: translateX(520%) skewX(-18deg); } }

@media print { .band, .card-stage { display: none; } }
