/* Home hero: headline reveal and the animated payment scene.
   States on .scene (set by hero.js): is-tap, is-reading, is-proc, is-ok, is-printed, is-paused.
   Default markup state is "is-ok is-printed", so the scene reads well with no JavaScript or with reduced motion. */

/* ---------- hero backdrop ---------- */
.hero { isolation: isolate; }
.hero::before, .hero::after { content: ""; position: absolute; z-index: -1; border-radius: 50%; opacity: .7; pointer-events: none; } /* soft gradients, no blur filter: cheaper on phones */
.hero::before { width: 520px; height: 520px; right: -120px; top: -160px; background: radial-gradient(circle, #FFB15E, transparent 65%); }
.hero::after { width: 420px; height: 420px; left: -160px; bottom: 40px; background: radial-gradient(circle, #FFE2C2, transparent 70%); }

/* ---------- headline reveal ---------- */
.hero__title .w { display: inline-block; }
.hero__title .hl--sweep { background: linear-gradient(var(--orange), var(--orange)) no-repeat 0 50% / 100% 100%; color: var(--ink); padding: 0 .14em .02em; margin-inline: -.04em; border-radius: .16em; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.eyebrow__pulse { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--orange); flex: none; }
.eyebrow__pulse::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid var(--orange); opacity: 0; }

/* ---------- scene layout ---------- */
.scene { position: relative; perspective: 1400px; }
.scene__tilt { transform-style: preserve-3d; transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .5s cubic-bezier(.2, .8, .2, 1); }
.scene__panel { position: relative; aspect-ratio: 520 / 470; border-radius: var(--r-xl); background: linear-gradient(155deg, #FFFFFF 0%, var(--cream) 38%, var(--orange-soft) 100%); border: 1px solid var(--line); box-shadow: var(--shadow-lg); overflow: hidden; transform-style: preserve-3d; }
.scene__glow { position: absolute; inset: 0; background: radial-gradient(240px circle at var(--gx, 70%) var(--gy, 20%), rgba(255, 255, 255, .75), transparent 70%); pointer-events: none; }
.scene__svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }

.scene__route { fill: none; stroke: #FF8200; stroke-width: 2.5; stroke-dasharray: 2 9; stroke-linecap: round; opacity: .9; }
.scene__spark { fill: #FF8200; filter: drop-shadow(0 0 6px rgba(255, 130, 0, .9)); }
.scene__rings circle { fill: none; stroke: rgba(255, 130, 0, .16); stroke-width: 1.5; transform-box: fill-box; transform-origin: center; }
.scene__terminal { filter: drop-shadow(0 20px 22px rgba(20, 20, 20, .18)); }

/* screen states */
.scr { opacity: 0; transition: opacity .25s ease; }
.scene:not(.is-proc):not(.is-ok) .scr--idle,
.scene.is-proc .scr--proc,
.scene.is-ok .scr--ok { opacity: 1; }
.scr__amt { font: 600 21px var(--font-text); fill: #141414; }
.scr__hint { font: 500 10.5px var(--font-text); fill: #595959; }
.scr__ok { font: 600 14px var(--font-text); fill: #141414; letter-spacing: .02em; }
.scr__spin { transform-box: fill-box; transform-origin: center; }
.scr__check { stroke-dasharray: 40; stroke-dashoffset: 0; }
.key--red { fill: #E5484D; } .key--yellow { fill: #F5C518; } .key--green { fill: #2FA84F; }

/* receipt */
.scene__receipt { transform: translateY(0); transition: transform 1.1s cubic-bezier(.3, .7, .2, 1); }
.scene:not(.is-printed) .scene__receipt { transform: translateY(96px); transition-duration: .5s; }
.scene__receipt-title { font: 700 11px var(--font-text); letter-spacing: .18em; fill: #B35900; }
.scene__receipt-label { font: 600 10px var(--font-text); letter-spacing: .12em; fill: #595959; }
.scene__receipt-amt { font: 700 15px var(--font-text); fill: #141414; letter-spacing: .02em; }

/* contactless waves */
.scene__waves circle { opacity: 0; transform-box: fill-box; transform-origin: center; }

/* card */
.scene__card { transform: translate(338px, 296px) rotate(-14deg); transition: transform .9s cubic-bezier(.5, 0, .2, 1); }
.scene.is-tap .scene__card { transform: translate(214px, 62px) rotate(-8deg); transition-duration: .8s; }
.scene.is-gone .scene__card { transform: translate(600px, 360px) rotate(-24deg); transition-duration: .7s; }
.scene.is-enter .scene__card { transition: none; }
.scene__card-inner { filter: drop-shadow(0 16px 18px rgba(20, 20, 20, .22)); }
.scene__card-face { fill: url(#vp-card); }
.scene[data-card="dark"] .scene__card-face { fill: url(#vp-card-dark); }
.scene[data-card="dark"] .scene__card-num { fill: #fff; }
.scene[data-card="dark"] .scene__card-nfc { stroke: #FF8200; }
.scene[data-card="light"] .scene__card-face { fill: #fff; }
.scene__card-num { font: 600 11px var(--font-text); letter-spacing: .14em; fill: #141414; }

/* floating chips (layer depth set by hero.js) */
.chip-float { position: absolute; display: grid; place-items: center; width: 54px; height: 54px; border-radius: 16px; background: var(--white); color: var(--orange-ink); box-shadow: var(--shadow); border: 1px solid var(--line); translate: var(--px, 0) var(--py, 0); transition: translate .5s cubic-bezier(.2, .8, .2, 1); }
.chip-float--1 { left: 5%; top: 7%; }
.chip-float--2 { right: 6%; top: 6%; }
.chip-float--3 { left: 4%; top: 46%; }
.chip-float--4 { right: 5%; bottom: 5%; }

/* toast */
.toast { position: absolute; left: 5%; bottom: 6%; display: flex; align-items: center; gap: .7rem; background: var(--white); border-radius: var(--r-md); padding: .7rem 1rem .7rem .75rem; box-shadow: var(--shadow-lg); border: 1px solid var(--line); font-size: .9rem; line-height: 1.3; color: var(--ink); translate: var(--px, 0) var(--py, 0); transition: translate .5s cubic-bezier(.2, .8, .2, 1), opacity .4s ease, transform .5s cubic-bezier(.3, 1.5, .5, 1); }
.toast strong { display: block; }
.toast__sub { display: block; color: var(--muted); font-size: .8rem; }
.toast__icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--orange); color: var(--ink); flex: none; }
.scene:not(.is-ok) .toast { opacity: 0; transform: translateY(14px) scale(.94); }

/* live sales card */
.sales { position: absolute; right: 3%; top: 27%; width: 33%; display: grid; gap: .2rem; background: var(--white); border-radius: var(--r-md); padding: .75rem .9rem .8rem; box-shadow: var(--shadow-lg); border: 1px solid var(--line); color: var(--ink); translate: var(--px, 0) var(--py, 0); transition: translate .5s cubic-bezier(.2, .8, .2, 1); }
.sales__label { display: flex; align-items: center; gap: .35rem; font-size: .75rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.sales__label .icon { color: var(--orange-ink); width: 16px; height: 16px; }
.sales__total { font: 600 1.35rem/1.2 var(--font-text); font-variant-numeric: tabular-nums; }
.sales__bars { display: flex; align-items: flex-end; gap: 5px; height: 36px; margin-top: .25rem; }
.sales__bars i { flex: 1; border-radius: 3px 3px 1px 1px; background: #EADFD1; height: var(--h, 40%); transition: height .7s cubic-bezier(.3, 1.4, .5, 1), background-color .4s ease; }
.sales__bars .b1 { --h: 34%; } .sales__bars .b2 { --h: 52%; } .sales__bars .b3 { --h: 41%; } .sales__bars .b4 { --h: 66%; }
.sales__bars .b5 { --h: 48%; } .sales__bars .b6 { --h: 72%; } .sales__bars .b7 { --h: 58%; background: var(--orange); }
.sales__bump { position: absolute; right: 10px; top: -14px; padding: .15rem .55rem; border-radius: 999px; background: var(--orange); color: var(--ink); font-size: .78rem; font-weight: 700; box-shadow: var(--shadow); opacity: 0; }

/* pause control */
.scene__pause { position: absolute; right: 12px; bottom: -18px; z-index: 2; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid var(--ink); background: var(--white); color: var(--ink); cursor: pointer; box-shadow: var(--shadow); }
.scene__pause:hover { background: var(--ink); color: var(--white); }
.scene__pause-icon--play { display: none; }
.scene.is-paused .scene__pause-icon--play { display: block; }
.scene.is-paused .scene__pause-icon--pause { display: none; }
.scene__pause-icon .icon { display: block; }

/* primary button shine (hero only) */
.hero .btn--primary { position: relative; overflow: hidden; }
.hero .btn--primary::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .55) 50%, transparent 70%); transform: translateX(-120%); }

/* ---------- motion (only when the visitor allows it) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js .hero__title .w { opacity: 0; transform: translateY(.45em); filter: blur(6px); animation: word-in .8s cubic-bezier(.2, .8, .2, 1) forwards; }
  .js .hero__title .w:nth-of-type(1) { animation-delay: .05s; } .js .hero__title .w:nth-of-type(2) { animation-delay: .12s; }
  .js .hero__title .w:nth-of-type(3) { animation-delay: .19s; } .js .hero__title .w:nth-of-type(4) { animation-delay: .32s; }
  .js .hero__title .w:nth-of-type(5) { animation-delay: .42s; } .js .hero__title .w:nth-of-type(6) { animation-delay: .49s; }
  .js .hero__title .w:nth-of-type(7) { animation-delay: .56s; } .js .hero__title .w:nth-of-type(8) { animation-delay: .63s; }
  .js .hero__title .w:nth-of-type(9) { animation-delay: .70s; }
  .js .hero__title .hl--sweep { background-size: 0% 100%; animation: sweep .9s cubic-bezier(.65, 0, .25, 1) 1s forwards; }
  .js .hero .eyebrow, .js .hero__lead, .js .hero .btn-row, .js .scene, .js .value-strip li { opacity: 0; animation: rise .9s cubic-bezier(.2, .8, .2, 1) forwards; }
  .js .hero .eyebrow { animation-delay: 0s; }
  .js .hero__lead { animation-delay: .8s; }
  .js .hero .btn-row { animation-delay: .95s; }
  .js .scene { animation: scene-in 1.2s cubic-bezier(.2, .8, .2, 1) .25s forwards; }
  .js .value-strip li:nth-child(1) { animation-delay: 1.1s; } .js .value-strip li:nth-child(2) { animation-delay: 1.18s; }
  .js .value-strip li:nth-child(3) { animation-delay: 1.26s; } .js .value-strip li:nth-child(4) { animation-delay: 1.34s; }
  .js .value-strip li:nth-child(5) { animation-delay: 1.42s; }
  .eyebrow__pulse::after { animation: pulse 2.2s ease-out infinite; }
  .hero::before { animation: drift-a 18s ease-in-out infinite alternate; }
  .hero::after { animation: drift-b 22s ease-in-out infinite alternate; }
  .scene__rings circle { animation: ring 5s ease-in-out infinite; }
  .scene__rings circle:nth-child(2) { animation-delay: .6s; } .scene__rings circle:nth-child(3) { animation-delay: 1.2s; }
  .chip-float { animation: float 6s ease-in-out infinite; }
  .chip-float--2 { animation-delay: -1.5s; } .chip-float--3 { animation-delay: -3s; } .chip-float--4 { animation-delay: -4.5s; }
  .sales { animation: float 7s ease-in-out -2s infinite; }
  .scene.is-proc .scr__spin { animation: spin .8s linear infinite; }
  .scene.is-ok .scr__check { animation: draw .5s cubic-bezier(.6, 0, .2, 1) both; }
  .scene.is-reading .scene__waves circle { animation: wave 1.2s ease-out infinite; }
  .scene.is-reading .scene__waves circle:nth-child(2) { animation-delay: .4s; }
  .scene.is-reading .scene__waves circle:nth-child(3) { animation-delay: .8s; }
  .scene.is-bump .sales__bump { animation: bump 1.4s ease-out forwards; }
  .scene.is-bump .sales__total { animation: flash .9s ease-out; }
  .hero .btn--primary:hover::after { transition: transform .8s ease; transform: translateX(120%); }
  .scene.is-paused *, .scene.is-paused *::before, .scene.is-paused *::after { animation-play-state: paused !important; }

  @keyframes word-in { to { opacity: 1; transform: none; filter: none; } }
  @keyframes sweep { to { background-size: 100% 100%; } }
  @keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
  @keyframes scene-in { from { opacity: 0; transform: translateY(30px) scale(.96); } to { opacity: 1; transform: none; } }
  @keyframes pulse { 0% { opacity: .8; transform: scale(.6); } 100% { opacity: 0; transform: scale(1.6); } }
  @keyframes drift-a { to { transform: translate(-80px, 60px) scale(1.15); } }
  @keyframes drift-b { to { transform: translate(90px, -40px) scale(.9); } }
  @keyframes ring { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.04); opacity: .45; } }
  @keyframes float { 50% { transform: translateY(-8px); } }
  @keyframes spin { to { transform: rotate(360deg); } }
  @keyframes draw { from { stroke-dashoffset: 40; } to { stroke-dashoffset: 0; } }
  @keyframes wave { 0% { opacity: .9; transform: scale(.55); } 100% { opacity: 0; transform: scale(1.9); } }
  @keyframes bump { 0% { opacity: 0; transform: translateY(8px); } 25% { opacity: 1; transform: none; } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-10px); } }
  @keyframes flash { 0% { color: var(--orange-ink); } 100% { color: var(--ink); } }
}

/* ---------- small screens ---------- */
@media (max-width: 900px) {
  .scene { max-width: 560px; margin-inline: auto; width: 100%; }
}
@media (max-width: 640px) {
  .chip-float { width: 40px; height: 40px; border-radius: 12px; }
  .chip-float .icon { width: 19px; height: 19px; }
  .toast { font-size: .78rem; padding: .45rem .7rem .45rem .5rem; gap: .5rem; }
  .toast__icon { width: 26px; height: 26px; }
  .toast__sub { font-size: .7rem; }
  .sales { width: 36%; padding: .5rem .6rem; right: 2%; }
  .sales__label { font-size: .6rem; letter-spacing: .03em; }
  .sales__total { font-size: 1rem; }
  .sales__bars { height: 24px; gap: 3px; }
  .sales__bump { font-size: .68rem; right: 6px; top: -12px; }
  .scene__pause { width: 44px; height: 44px; bottom: -22px; }
  .chip-float--4 { bottom: 12%; }
}
.scene__pause[hidden] { display: none; }
