/* Derulare tip „rulou” cu centrare și desene animate cu înțeles.
   Starea de bază a fiecărui desen este cea finală: fără JavaScript sau cu mișcare redusă totul se vede complet. */
main { overflow-x: clip; }

/* --p merge de la 0 (jos, abia apărut) la 1 (așezat la locul lui); îl calculează pagina.js */
.rulou.activ-rulou {
  opacity: calc(.08 + .92 * var(--p, 0));
  transform: perspective(1100px)
    translate3d(calc(var(--dx, 0px) * (1 - var(--p, 0))), calc(90px * (1 - var(--p, 0))), 0)
    rotateX(calc(22deg * (1 - var(--p, 0))))
    scale(calc(.84 + .16 * var(--p, 0)));
  transform-origin: 50% 100%;
}
.grila article { transition: border-color .4s, box-shadow .4s; }
.grila article.centru { border-color: var(--violet); box-shadow: 0 24px 50px -28px rgb(139 108 255 / .75); }

/* Desene */
.desen { display: block; overflow: visible; fill: var(--violet-deschis); }
.titlu-ico .desen, .contact .desen { width: 4rem; height: 2.5rem; margin-bottom: .75rem; }
.contact .desen { margin-inline: auto; }
.desen.mare { width: 100%; max-width: 14rem; height: auto; margin: 0 auto 1rem; }
.desen .linie { fill: none; stroke: var(--violet-deschis); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.desen .text { stroke: var(--sters); }
.desen .plin { fill: var(--violet); }
.desen .rosu { fill: #ff8fa3; }
.desen .verde { fill: var(--menta); }
.desen .alb { fill: var(--text); }
.desen .semn, .desen .bifare, .desen .crapatura, .desen .tendinta, .desen .puncte { fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-width: 3; }
.desen .semn { stroke: #17111f; }
.desen .bifare { stroke: var(--menta); }
.desen .crapatura { stroke: #ff8fa3; stroke-width: 2; }
.desen .tendinta { stroke: var(--text); stroke-width: 2.4; }
.desen .puncte { stroke: var(--menta); stroke-width: 3.5; }
.desen text { font: 700 20px var(--titlu); text-anchor: middle; fill: var(--menta); }
.desen .cifra { font-size: 13px; fill: #ff8fa3; }
.desen .eticheta { fill: rgb(255 143 163 / .14); stroke: #ff8fa3; }
.desen .lichid { fill: var(--violet); opacity: .75; }
.sticle { display: grid; grid-template-columns: repeat(15, minmax(0, 1fr)); gap: .3rem; align-items: end; margin: .25rem 0 1rem; }
.sticle i { position: relative; height: 2.6rem; background: var(--violet); clip-path: polygon(34% 0, 66% 0, 66% 24%, 100% 42%, 100% 100%, 0 100%, 0 42%, 34% 24%); transform-origin: bottom; }
.sticle .partial { background: linear-gradient(to top, var(--violet) 20%, var(--menta) 20%); }
.baxuri { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; margin-top: .25rem; }
.baxuri b { display: grid; grid-template-columns: repeat(6, 1fr); gap: 2px; padding: .35rem; border: 1px solid var(--violet); border-radius: .4rem; }
.baxuri i { aspect-ratio: 1; border-radius: 50%; background: var(--violet); }
.baxuri i.plus { background: var(--menta); }
.ladita { fill: var(--card); stroke: var(--violet); stroke-width: 2.2; }

.acces { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; margin-top: 1rem; }
.acces li { display: inline-flex; align-items: center; gap: .35rem; padding: .25rem .65rem; border-radius: 2rem; border: 1px solid; font-size: .82rem; }
.acces .da { color: var(--menta); }
.acces .da::before { content: "✓"; }
.acces .nu { color: var(--sters); border-style: dashed; text-decoration: line-through; }
.acces .nu::before { content: "✕"; text-decoration: none; }

/* Iconițe din butoane */
.ico { flex: none; width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.buton { gap: .5rem; }
.pasi .ico { color: var(--violet-deschis); }

@media (prefers-reduced-motion: no-preference) {
  .desen *, .ico .misca { transform-box: fill-box; transform-origin: center; }

  /* o zi de lucru: soarele traversează cerul */
  .a-zi .soare { transform-box: view-box; transform-origin: 32px 34px; }
  .a-zi.joaca .soare { animation: zi 2.4s cubic-bezier(.4, 0, .3, 1) backwards; }
  /* drumul mărfii: camionul ajunge la destinație */
  .a-drum.joaca .camion { animation: drum 1.8s cubic-bezier(.2, .8, .25, 1.1) backwards; }
  .a-drum.joaca .camion circle { animation: invarte 1.8s ease-out; }
  /* stoc: nivelurile scad, apoi apare avertizarea */
  .a-stoc.joaca .n1, .a-stoc.joaca .n2, .a-stoc.joaca .n3 { transform-origin: bottom; animation: scade 1.4s cubic-bezier(.3, .7, .2, 1) backwards; }
  .a-stoc.joaca .n2 { animation-delay: .15s; } .a-stoc.joaca .n3 { animation-name: scade-mult; animation-delay: .3s; }
  .a-stoc.joaca .alarma { animation: pop .6s 1.6s cubic-bezier(.2, .9, .3, 1.8) backwards, tremur .6s 2.3s 2; }
  /* rețetă: ingredientele intră în pahar, apoi apare marja */
  .a-reteta.joaca .g1 { animation: toarna1 .8s ease-in both; }
  .a-reteta.joaca .g2 { animation: toarna2 .8s .3s ease-in both; }
  .a-reteta.joaca .g3 { animation: toarna3 .8s .6s ease-in both; }
  .a-reteta.joaca .lichid { transform-origin: bottom; animation: umple-sus 1.2s .6s ease-out backwards; }
  .a-reteta.joaca .procent { animation: pop .6s 1.8s cubic-bezier(.2, .9, .3, 1.8) backwards; }
  /* NIR: sosește cutia, iese documentul, se bifează */
  .a-nir.joaca .cutie { animation: din-stanga .8s cubic-bezier(.2, .9, .3, 1.2) backwards; }
  .a-nir.joaca .hartie { transform-origin: top; animation: deruleaza .9s .7s ease-out backwards; }
  .a-nir.joaca .bifa { animation: pop .6s 1.6s cubic-bezier(.2, .9, .3, 1.8) backwards; }
  /* pierderi: paharul se înclină și crapă, apoi se notează */
  .a-pierderi.joaca .pahar { transform-origin: bottom right; animation: cade 1.1s ease-in-out; }
  .a-pierderi.joaca .crapatura { animation: apare .2s .55s backwards; }
  .a-pierderi.joaca .s1, .a-pierderi.joaca .s2, .a-pierderi.joaca .s3 { animation: stropi .7s .55s ease-out backwards; }
  .a-pierderi.joaca .s2 { animation-delay: .65s; } .a-pierderi.joaca .s3 { animation-delay: .75s; }
  .a-pierderi.joaca .nota-doc { animation: urca .7s 1.2s cubic-bezier(.2, .9, .3, 1.3) backwards; }
  /* inventar: bifezi pe rând, apoi apare diferența */
  .a-inventar.joaca .bifare { animation: pop .4s .3s cubic-bezier(.2, .9, .3, 1.8) backwards; }
  .a-inventar.joaca .b2 { animation-delay: .75s; } .a-inventar.joaca .b3 { animation-delay: 1.2s; }
  .a-inventar.joaca .diferenta { animation: din-dreapta .7s 1.7s cubic-bezier(.2, .9, .3, 1.4) backwards; }
  /* rapoarte: coloane și linia de tendință */
  .a-rapoarte.joaca .c1, .a-rapoarte.joaca .c2, .a-rapoarte.joaca .c3, .a-rapoarte.joaca .c4 { transform-origin: bottom; animation: creste .8s cubic-bezier(.2, .9, .3, 1.25) backwards; }
  .a-rapoarte.joaca .c2 { animation-delay: .15s; } .a-rapoarte.joaca .c3 { animation-delay: .3s; } .a-rapoarte.joaca .c4 { animation-delay: .45s; }
  .a-rapoarte.joaca .tendinta { stroke-dasharray: 100; animation: deseneaza 1.1s .8s ease-out backwards; }
  /* sticle și bax: ce lipsește, apoi rotunjirea în sus (verde) */
  .a-bax.joaca .sticla { animation: coboara .7s cubic-bezier(.3, .8, .3, 1.3) backwards; }
  .a-bax.joaca .s2 { animation-delay: .25s; } .a-bax.joaca .s3 { animation-delay: .5s; }
  .a-sticle.joaca i { animation: creste .45s ease-out backwards; }
  .a-sticle.joaca i:nth-child(n+4) { animation-delay: .15s; } .a-sticle.joaca i:nth-child(n+7) { animation-delay: .3s; }
  .a-sticle.joaca i:nth-child(n+10) { animation-delay: .45s; } .a-sticle.joaca i:nth-child(n+13) { animation-delay: .6s; }
  .a-sticle.joaca i.partial { animation: pop .6s 1.4s cubic-bezier(.2, .9, .3, 1.8) backwards; }
  .a-puncte.joaca b { animation: pop .45s cubic-bezier(.2, .9, .3, 1.5) backwards; }
  .a-puncte.joaca b:nth-child(2) { animation-delay: .25s; } .a-puncte.joaca b:nth-child(3) { animation-delay: .5s; } .a-puncte.joaca b:nth-child(4) { animation-delay: .75s; }
  .a-puncte.joaca i.plus { animation: pop .5s 1.6s cubic-bezier(.2, .9, .3, 1.6) backwards; }
  /* roluri: ochiul clipește, apar pe rând drepturile */
  .a-ochi.joaca .ochi { animation: clipeste 1.4s .3s ease-in-out 2; }
  .a-acces.joaca li { animation: pop .45s cubic-bezier(.2, .9, .3, 1.6) backwards; }
  .a-acces.joaca li:nth-child(2) { animation-delay: .35s; } .a-acces.joaca li:nth-child(3) { animation-delay: .7s; }
  /* contact: cele două replici ale unei conversații */
  .a-vorba.joaca .b1 { animation: pop .5s cubic-bezier(.2, .9, .3, 1.7) backwards; }
  .a-vorba.joaca .b2 { animation: pop .5s .6s cubic-bezier(.2, .9, .3, 1.7) backwards; }

  /* butoane */
  .a-mesaj.joaca .misca { animation: scrie .5s .4s ease-in-out 4; }
  .a-suna.joaca .misca { animation: tremur .5s .6s ease-in-out 3; }
  .a-email.joaca .misca { animation: trimite 1.1s .8s ease-in-out; }
  .a-deschide.joaca .misca { animation: deschide .8s .8s ease-in-out 2; }
  .a-intra.joaca .misca { animation: intra .8s .5s ease-in-out 2; }
  .a-cookie.joaca .misca { animation: invarte 1s .3s cubic-bezier(.3, .8, .3, 1.2); }
  .pasi button[aria-pressed="true"] .misca { animation: pas 1s cubic-bezier(.2, .9, .3, 1.5); }

  /* butonul de oprire: fără mișcare, totul în starea finală */
  body.oprit-tot .joaca, body.oprit-tot .joaca *, body.oprit-tot .ecran, body.oprit-tot .ecran * { animation: none !important; transition: none !important; }
  body.oprit-tot .rulou.activ-rulou { opacity: 1; transform: none; }
}

@keyframes zi { from { transform: rotate(-85deg); } 60% { transform: rotate(55deg); } }
@keyframes drum { from { transform: translateX(-60px); opacity: 0; } 20% { opacity: 1; } to { transform: translateX(14px); } }
.a-drum .camion { transform: translateX(14px); }
@keyframes invarte { from { transform: rotate(-360deg); } }
@keyframes scade { from { transform: scaleY(1.35); } }
@keyframes scade-mult { from { transform: scaleY(4.6); } }
@keyframes tremur { 25% { transform: rotate(-14deg); } 75% { transform: rotate(14deg); } }
@keyframes toarna1 { 60% { transform: translate(61px, -6px); } to { transform: translate(61px, 24px) scale(.2); opacity: 0; } }
@keyframes toarna2 { 60% { transform: translate(61px, -26px); } to { transform: translate(61px, 8px) scale(.2); opacity: 0; } }
@keyframes toarna3 { 60% { transform: translate(61px, -46px); } to { transform: translate(61px, -10px) scale(.2); opacity: 0; } }
@keyframes umple-sus { from { transform: scaleY(0); } }
@keyframes din-stanga { from { transform: translateX(-50px); opacity: 0; } }
@keyframes din-dreapta { from { transform: translateX(40px); opacity: 0; } }
@keyframes deruleaza { from { transform: scaleY(0); opacity: 0; } }
@keyframes cade { 50% { transform: rotate(18deg); } 70% { transform: rotate(12deg); } }
@keyframes apare { from { opacity: 0; } }
@keyframes stropi { from { transform: translate(-18px, -14px); opacity: 0; } }
@keyframes deseneaza { from { stroke-dashoffset: 100; } }
@keyframes coboara { from { transform: translateY(-22px); opacity: 0; } }
@keyframes clipeste { 40%, 55% { transform: scaleY(.08); } }
@keyframes scrie { 50% { transform: translateY(-2.5px); } }
@keyframes trimite { 40% { transform: translate(14px, -10px) scale(.7); opacity: 0; } 41% { transform: translate(-14px, 8px) scale(.7); opacity: 0; } }
@keyframes deschide { 50% { transform: translate(3px, -3px); } }
@keyframes intra { 50% { transform: translateX(3px); } }
@keyframes pas { from { transform: translateY(-5px) scale(.7); } }
