/* Quiet Logic Games — "Play" motion style (concept C), site-wide. CSS only, no scripts.
   Entrance animations use fill "backwards" so hover transforms keep working after they finish.
   Everything is disabled for visitors who ask their device to reduce motion. */
@media (prefers-reduced-motion: no-preference){

/* ---------- Keyframes ---------- */
@keyframes qp-flow{to{background-position:140px 140px}}
@keyframes qp-drop{0%{opacity:0;transform:translateY(-60px) rotate(-14deg)}60%{opacity:1;transform:translateY(6px) rotate(3deg)}100%{transform:none}}
@keyframes qp-up{from{opacity:0;transform:translateY(18px)}to{opacity:1;transform:none}}
@keyframes qp-shine{0%,60%{transform:translateX(-120%)}100%{transform:translateX(120%)}}
@keyframes qp-flip{from{opacity:0;transform:perspective(900px) rotateY(75deg) scale(.9)}to{opacity:1;transform:perspective(900px) rotateY(0)}}
@keyframes qp-card{from{opacity:0;transform:perspective(900px) rotateX(55deg) translateY(30px)}to{opacity:1;transform:perspective(900px)}}
@keyframes qp-spin-in{from{transform:scale(0) rotate(-180deg)}to{transform:none}}
@keyframes qp-fall{0%{opacity:0;transform:translateY(-22px)}12%{opacity:1;transform:translateY(2px)}16%,58%{transform:none;opacity:1}66%{transform:scale(1.45);opacity:1;filter:brightness(1.3)}72%,100%{transform:scale(0);opacity:0}}
@keyframes qp-turn{0%,40%{transform:rotate(0)}50%,100%{transform:rotate(90deg)}}
@keyframes qp-boing{0%,100%{transform:none}40%{transform:translateY(-6px) scale(1.15)}}
@keyframes qp-pop{0%{opacity:0;transform:scale(.6)}70%{transform:scale(1.08)}100%{opacity:1;transform:none}}

/* ---------- Arrow field behind heroes ---------- */
.site-frame .quiet-hero,.site-frame .page-hero,.site-frame .product-hero{position:relative}
.site-frame .page-hero,.site-frame .product-hero{overflow:hidden}
.site-frame :is(.quiet-hero,.page-hero,.product-hero)>*:not(.qp-field){position:relative;z-index:1}
.qp-field{position:absolute;z-index:0;inset:-20px -40px;pointer-events:none;opacity:.55;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cg fill='none' stroke='%23075b47' stroke-width='3' stroke-linecap='round' stroke-linejoin='round' opacity='.35'%3E%3Cpath d='M16 34h34m-9-9 9 9-9 9'/%3E%3Cpath d='M98 78v34m-9-9 9 9 9-9'/%3E%3Cpath d='M60 124l22-22m-12 0h12v12'/%3E%3C/g%3E%3C/svg%3E");
  background-size:140px 140px;animation:qp-flow 18s linear infinite;
  -webkit-mask-image:radial-gradient(ellipse at 70% 45%,#000 0,#0000 70%);mask-image:radial-gradient(ellipse at 70% 45%,#000 0,#0000 70%)}
.page-hero .qp-field{inset:0;opacity:.45;-webkit-mask-image:radial-gradient(ellipse at 85% 50%,#000 0,#0000 65%);mask-image:radial-gradient(ellipse at 85% 50%,#000 0,#0000 65%)}
[dir=rtl] .page-hero .qp-field{-webkit-mask-image:radial-gradient(ellipse at 15% 50%,#000 0,#0000 65%);mask-image:radial-gradient(ellipse at 15% 50%,#000 0,#0000 65%)}
.product-hero .qp-field{inset:0;opacity:.6;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cg fill='none' stroke='%23dfbd72' stroke-width='3' stroke-linecap='round' stroke-linejoin='round' opacity='.3'%3E%3Cpath d='M16 34h34m-9-9 9 9-9 9'/%3E%3Cpath d='M98 78v34m-9-9 9 9 9-9'/%3E%3Cpath d='M60 124l22-22m-12 0h12v12'/%3E%3C/g%3E%3C/svg%3E")}

/* ---------- Home hero ---------- */
.qp-letters span{display:inline-block;animation:qp-drop .7s cubic-bezier(.3,1.4,.5,1) backwards;transition:transform .25s,color .25s}
.qp-letters span:nth-child(1){animation-delay:.05s}.qp-letters span:nth-child(2){animation-delay:.11s}.qp-letters span:nth-child(3){animation-delay:.17s}
.qp-letters span:nth-child(4){animation-delay:.23s}.qp-letters span:nth-child(5){animation-delay:.29s}.qp-letters span:nth-child(6){animation-delay:.35s}
.qp-letters span:nth-child(7){animation-delay:.41s}.qp-letters span:nth-child(8){animation-delay:.47s}.qp-letters span:nth-child(9){animation-delay:.53s}
.qp-letters span:hover{transform:translateY(-10px) rotate(-6deg);color:var(--pine)}
.quiet-hero__copy>:not(h1){animation:qp-up .6s .65s cubic-bezier(.2,.8,.2,1) backwards}
.quiet-hero__copy>:nth-child(4){animation-delay:.75s}
.quiet-hero__copy>:nth-child(5){animation-delay:.85s}
.quiet-hero__copy>:nth-child(6){animation-delay:.95s}
.site-frame .quiet-gallery__frames{animation:qp-flip 1s .5s cubic-bezier(.2,.8,.2,1) backwards;transition:transform .4s}
.site-frame .quiet-gallery__frames:hover{transform:perspective(900px) rotateY(-8deg) rotateX(5deg)}
.site-frame .quiet-gallery__board{box-shadow:0 24px 50px #13211c1c}

/* ---------- Inner page heroes ---------- */
.page-hero__copy>*{animation:qp-up .6s cubic-bezier(.2,.8,.2,1) backwards}
.page-hero__copy>.eyebrow{animation:qp-pop .5s cubic-bezier(.3,1.5,.5,1) backwards}
.page-hero__copy>h1{animation:qp-drop .8s .1s cubic-bezier(.3,1.3,.5,1) backwards}
.page-hero__copy>:nth-child(3){animation-delay:.35s}
.page-hero__copy>:nth-child(4){animation-delay:.45s}
.product-hero__copy>*{animation:qp-up .6s cubic-bezier(.2,.8,.2,1) backwards}
.product-hero__copy>:nth-child(2){animation-delay:.1s}.product-hero__copy>:nth-child(3){animation-delay:.2s}
.product-hero__copy>:nth-child(4){animation-delay:.3s}.product-hero__copy>:nth-child(5){animation-delay:.4s}
.product-hero__screens figure{animation:qp-flip 1s .3s cubic-bezier(.2,.8,.2,1) backwards;transition:transform .4s}
.product-hero__screens figure:nth-child(2){animation-delay:.5s}
.product-hero__screens figure:hover{transform:perspective(900px) rotateY(-8deg) rotateX(5deg)}

/* ---------- Buttons: light sweep ---------- */
.site-frame :is(.quiet-hero__download,.primary-button){position:relative;overflow:hidden;transition:transform .2s}
.site-frame :is(.quiet-hero__download,.primary-button)::before{content:"";position:absolute;inset:0;pointer-events:none;background:linear-gradient(110deg,#0000 30%,#ffffff55 50%,#0000 70%);transform:translateX(-120%);animation:qp-shine 3.5s 1.6s ease-in-out infinite}
.site-frame :is(.quiet-hero__download,.primary-button):hover{transform:translateY(-2px) scale(1.03)}

/* ---------- Home lineup ---------- */
.qlg-stop__dot{border-radius:5px;rotate:45deg;animation:qp-spin-in .7s cubic-bezier(.3,1.5,.5,1) backwards}
.qlg-stop:nth-child(2) .qlg-stop__dot{animation-delay:.25s}
.qlg-stop:nth-child(3) .qlg-stop__dot{animation-delay:.5s}
.qlg-stop__card{animation:qp-card .8s cubic-bezier(.2,.8,.2,1) backwards}
.qlg-stop:nth-child(2) .qlg-stop__card{animation-delay:.15s}
.qlg-stop:nth-child(3) .qlg-stop__card{animation-delay:.3s}
.qlg-stop__link{transition:letter-spacing .25s}
.qlg-stop__link:hover{letter-spacing:.03em}
.qlg-stop__glyph{animation:qp-turn 3s ease-in-out infinite alternate}

/* ---------- Trio tiles: a tiny match-three loop ---------- */
.trio-tiles i,.trio-visual i{animation:qp-fall 3.2s cubic-bezier(.3,1.3,.5,1) infinite}
.trio-tiles i:nth-child(2),.trio-visual i:nth-child(2){animation-delay:.15s}
.trio-tiles i:nth-child(3),.trio-visual i:nth-child(3){animation-delay:.3s}

/* ---------- Cards everywhere: flip up on entry, tilt on hover ---------- */
:is(.qlg-stop__card,[data-ui=card]:not(details,.product-hero),.values-preview__grid article){transition:transform .35s cubic-bezier(.2,.8,.2,1),box-shadow .35s}
:is(.qlg-stop__card,[data-ui=card]:not(details,.product-hero),.values-preview__grid article):hover{transform:perspective(900px) rotateX(5deg) rotateY(-5deg) translateY(-6px);box-shadow:0 28px 46px #13211c24}
details[data-ui=card]{transition:transform .3s,box-shadow .3s}
details[data-ui=card]:hover{transform:translateY(-3px);box-shadow:0 16px 30px #13211c1a}
:is([data-ui=card]:not(.product-hero),.values-preview__grid article):hover>span:first-child{display:inline-block;animation:qp-boing .5s ease}
.founder-mark{animation:qp-spin-in .9s cubic-bezier(.3,1.5,.5,1) backwards}

@supports (animation-timeline: view()){
  .qlg-stop__card,.qlg-stop__dot,[data-ui=card]:not(.product-hero),.values-preview__grid article,.company-intro>*,.values-preview__statement,.section-heading,.story-copy>*,.games-list__context,.founder-mark{
    animation:qp-card linear backwards;animation-timeline:view();animation-range:entry 0% cover 30%;animation-delay:0s}
  .qlg-stop__dot{animation-name:qp-spin-in}
  .founder-mark{animation-name:qp-spin-in}
  .story-copy>*,.section-heading,.games-list__context,.company-intro>*,.values-preview__statement{animation-name:qp-up}
  :is(.qlg-stop,.values-preview__grid article,[data-ui=card]):nth-child(2),
  :is(.qlg-stop,.values-preview__grid article,[data-ui=card]):nth-child(2) .qlg-stop__card{animation-range:entry 6% cover 36%}
  :is(.qlg-stop,.values-preview__grid article,[data-ui=card]):nth-child(3),
  :is(.qlg-stop,.values-preview__grid article,[data-ui=card]):nth-child(3) .qlg-stop__card{animation-range:entry 12% cover 42%}
  /* Long reading pages: a calm rise only, no flips */
  .legal-document>article{animation:qp-up linear backwards;animation-timeline:view();animation-range:entry 0% cover 20%}
}
}
