/* StockSonar motion layer. Sits on top of home.css; everything here is decoration and
   switches off for people who ask their device for less motion. */

/* 1 ── headline letters drop in, the country flashes signal-orange */
.cl { display: inline-block; opacity: 0; animation: cl-in .7s cubic-bezier(.18, .86, .28, 1.12) forwards; }
.cw { display: inline-block; white-space: nowrap; }
.where .cl { animation: cl-in .7s cubic-bezier(.18, .86, .28, 1.12) forwards, cl-flash 1.4s ease-out; }
@keyframes cl-in { from { opacity: 0; transform: translateY(-.14em); } to { opacity: 1; transform: none; } }
@keyframes cl-flash { 0%, 55% { color: #fff; text-shadow: 0 0 18px rgba(255, 91, 46, .9); } }

/* 2 ── a slow sonar sweep behind the live check */
.check { overflow: hidden; }
.sweep { position: absolute; left: 50%; top: -38vmax; width: 76vmax; height: 76vmax; margin-left: -38vmax; border-radius: 50%; pointer-events: none;
  background: conic-gradient(from 0deg, rgba(255, 91, 46, .11), rgba(255, 91, 46, 0) 50deg, transparent 360deg);
  mask-image: radial-gradient(circle, #000 0 55%, transparent 70%); animation: sweep 9s linear infinite; }
.sweep::after { content: ""; position: absolute; inset: 22%; border-radius: 50%; border: 1px solid rgba(255, 91, 46, .08); box-shadow: 0 0 0 9vmax rgba(255, 91, 46, .025); }
@keyframes sweep { to { transform: rotate(360deg); } }

/* 3 ── console tiles rise in one after another; in-stock tiles send out a sonar ping */
.card.rise { animation: rise .55s cubic-bezier(.2, .8, .25, 1.05) both; animation-delay: calc(var(--i, 0) * 70ms); }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
.card.in { position: relative; }
.card.in::after { content: ""; position: absolute; inset: -1.5px; border-radius: inherit; pointer-events: none; animation: tile-ping 1.8s ease-out infinite; }
@keyframes tile-ping { 0% { box-shadow: 0 0 0 0 rgba(61, 220, 151, .55); } 70% { box-shadow: 0 0 0 14px rgba(61, 220, 151, 0); } 100% { box-shadow: 0 0 0 0 rgba(61, 220, 151, 0); } }

/* 4 ── chunky buttons: a solid lip underneath that you press down into */
.refresh, .btn-signal { --lip: #b23a17; box-shadow: 0 4px 0 var(--lip); transition: transform 80ms ease-out, box-shadow 80ms ease-out, background .15s, filter .15s; }
.refresh { --lip: #8f8a80; }
.refresh:hover:not(:disabled), .btn-signal:hover { filter: brightness(1.05); }
.refresh:active:not(:disabled), .btn-signal:active { transform: translateY(4px); box-shadow: 0 0 0 var(--lip); }
.refresh:disabled { box-shadow: 0 4px 0 #121216; }
.refresh.spin:disabled { box-shadow: 0 4px 0 var(--lip); animation: btn-ping 1.2s ease-out infinite; }
.refresh.done { --lip: #1f8a5c; }
@keyframes btn-ping { 0% { box-shadow: 0 4px 0 var(--lip), 0 0 0 0 rgba(244, 241, 234, .45); } 70% { box-shadow: 0 4px 0 var(--lip), 0 0 0 14px rgba(244, 241, 234, 0); } 100% { box-shadow: 0 4px 0 var(--lip), 0 0 0 0 rgba(244, 241, 234, 0); } }

/* 5 ── section titles decode out of sonar noise (JS swaps the glyphs) */
.decoding .dg { color: var(--signal); opacity: .75; }

/* 5b ── "Proof, not promises." slides in from the left once the line above has resolved */
.punch { display: inline-block; opacity: 0; transform: translateX(-40px); }
.punch.in { animation: punch-in 1.2s cubic-bezier(.2, .9, .25, 1.08) .3s forwards; }
@keyframes punch-in { to { opacity: 1; transform: none; } }

/* 12 ── restock facts as dot-matrix numbers (like a departure board): pixels light up on entry */
.fact b.dm { display: flex; align-items: flex-end; gap: 8px; margin: 6px 0 2px; line-height: 1; }
.fact b.dm svg { height: 30px; width: auto; flex: none; overflow: visible; }
.fact b.dm svg rect { fill: var(--ink); }
.fact b.dm.lit svg rect { opacity: 0; animation: px-on .18s steps(1) forwards; }
@keyframes px-on { to { opacity: 1; } }
.fact b.dm .unit { font: 500 11px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); padding-bottom: 2px; }
.fact b.now { display: flex; align-items: center; gap: 8px; height: 30px; margin: 6px 0 2px; color: var(--live); }
.fact b.now::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--live); flex: none; animation: ping 2s infinite; }
@media (max-width: 640px) { .fact b.now { height: 24px; } }
@media (max-width: 640px) { .fact b.dm svg { height: 24px; } .fact b.dm { gap: 6px; } .fact b.dm .unit { font-size: 10px; letter-spacing: .08em; } }

/* 6 ── eyebrows get a flowing ››› */
.eyebrow::before { content: "›››"; display: inline-block; margin-right: 10px; letter-spacing: -.05em;
  background: linear-gradient(90deg, var(--signal) 0 33%, rgba(255, 91, 46, .25) 33% 100%); background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: chev 1.2s steps(3) infinite; }
@keyframes chev { from { background-position: 100% 0; } to { background-position: -50% 0; } }

/* 7 ── things slide up as they scroll into view, staggered */
.rv { opacity: 0; transform: translateY(16px); transition: opacity .55s ease-out, transform .55s cubic-bezier(.2, .8, .25, 1); transition-delay: calc(var(--i, 0) * 80ms); }
.rv.seen { opacity: 1; transform: none; }

/* 8 ── the "How alerts work" pictures move */
.step .art svg .sweep-arm { transform-origin: 45px 45px; animation: sweep 3.2s linear infinite; }
.step .art svg .blip { animation: blip 3.2s ease-out infinite; }
@keyframes blip { 0%, 55% { opacity: 0; r: 2; } 62% { opacity: 1; r: 6; } 100% { opacity: 0; r: 4; } }
.step .art svg .flow { animation: flow .6s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -8; } }
.step .art svg .notif { animation: notif 3.4s cubic-bezier(.2, .8, .25, 1.15) infinite; transform-box: fill-box; }
@keyframes notif { 0% { opacity: 0; transform: translateY(-14px); } 12%, 80% { opacity: 1; transform: none; } 100% { opacity: 0; transform: none; } }
.step .art svg .notif2 { animation: notif 3.4s cubic-bezier(.2, .8, .25, 1.15) infinite .15s; transform-box: fill-box; }

/* 9 ── corner brackets on the checkout box and the closing section */
.brk { position: relative; }
.brk::before, .brk::after { content: ""; position: absolute; width: 16px; height: 16px; pointer-events: none; border: 2px solid var(--signal); }
.brk::before { left: -8px; top: -8px; border-right: 0; border-bottom: 0; }
.brk::after { left: -8px; bottom: -8px; border-right: 0; border-top: 0; }
.brk.rv::before, .brk.rv::after { transition: transform .5s cubic-bezier(.2, .8, .25, 1.2) .25s; transform: scale(0); }
.brk.rv.seen::before, .brk.rv.seen::after { transform: none; }
.brk.rv::before { transform-origin: 0 0; } .brk.rv::after { transform-origin: 0 100%; }

/* 10 ── "Start getting pinged." pings */
.final { position: relative; overflow: hidden; }
.final .rings { position: absolute; left: 50%; top: 50%; width: 0; height: 0; pointer-events: none; }
.final .rings i { position: absolute; left: -60px; top: -60px; width: 120px; height: 120px; border-radius: 50%; border: 1.5px solid rgba(255, 91, 46, .35); animation: ring 4.5s ease-out infinite; }
.final .rings i:nth-child(2) { animation-delay: 1.5s; } .final .rings i:nth-child(3) { animation-delay: 3s; }
@keyframes ring { from { transform: scale(.3); opacity: 1; } to { transform: scale(7); opacity: 0; } }
.final .wrap { position: relative; }

/* 11 ── numbers count up (JS); keep their width steady while they do */
.fact b { font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
  .cl, .where .cl, .card.rise, .card.in::after, .refresh.spin:disabled, .eyebrow::before, .sweep, .final .rings i,
  .step .art svg * { animation: none !important; opacity: 1; }
  .sweep, .final .rings { display: none; }
  .rv { opacity: 1; transform: none; transition: none; }
  .brk.rv::before, .brk.rv::after { transform: none; transition: none; }
}
