/* «يلا نتعلم»: science's own steps and drawings (learn/grade-3/science/steps.js and art.js). Loaded after learn/lesson-ar.css. */
.plPic.arArt { background: none; }
.arArt svg { display: block; width: 100%; height: 100%; }

/* a big drawing to touch */
.scScene { flex: none; position: relative; align-self: center; width: min(100%, 420px); width: min(100%, clamp(250px, 52dvh, 460px)); }
.scScene > svg { display: block; width: 100%; height: auto; filter: drop-shadow(0 8px 10px rgba(27, 42, 74, .16)); }
.scScene [data-part] { cursor: pointer; transition: filter .25s; }
.scScene [data-part].on { filter: drop-shadow(0 0 5px #FFD23F) brightness(1.08); }
.scScene [data-part].no { animation: scNo .4s ease; }
@keyframes scNo { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
.scOnPic .scBase { display: block; width: 100%; filter: drop-shadow(0 8px 10px rgba(27, 42, 74, .2)); }
.scHot { position: absolute; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; }
.scHot.on { background: rgba(255, 210, 63, .34); box-shadow: 0 0 0 3px #FFD23F; }
.scHot.no { animation: scNo .4s ease; }
.scTag { position: absolute; transform: translate(-50%, -50%); padding: 1px 11px; border-radius: 999px; background: #fff; color: var(--ink); font: 800 clamp(.95rem, 2.2dvh, 1.1rem)/1.5 var(--display); white-space: nowrap; box-shadow: 0 3px 0 var(--line), 0 4px 10px rgba(27, 42, 74, .2); animation: arPop .35s cubic-bezier(.2, 1.6, .4, 1); pointer-events: none; }
.scTodo { flex: none; align-self: center; min-height: 1.6em; padding: 2px 18px; border-radius: 999px; background: var(--sun); color: var(--sunInk); font: 800 clamp(1.1rem, 2.6dvh, 1.3rem)/1.5 var(--display); box-shadow: 0 3px 0 var(--sunD); }
.scTodo:empty { visibility: hidden; }
.scGo { flex: none; align-self: center; margin-top: 0; padding: 6px 26px; border: 0; color: var(--sunInk); cursor: pointer; animation: arCall 1.1s ease-in-out infinite; }
.scGo.wait { visibility: hidden; animation: none; }

/* the stages, in order */
.scTrack { flex: none; display: flex; align-items: center; justify-content: center; gap: 3px; }
.scTrack .arArrow { width: 7px; height: 7px; border-width: 2.5px 0 0 2.5px; }
.scSlot { flex: 1 1 0; min-width: 0; max-width: 92px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 1px; min-height: 92px; padding: 5px 2px 3px; border: 3px dashed #8FD0F5; border-radius: 16px; background: rgba(255, 255, 255, .6); font-size: .74rem; font-weight: 700; line-height: 1.25; text-align: center; }
.scSlot b { margin: auto; color: #8FB9D6; font: 800 1.5rem/1 var(--display); }
.scSlot.on { border: 3px solid var(--okD); background: var(--okBg); color: #0B6B49; }
.scMini { width: min(100%, 50px); animation: arPop .4s cubic-bezier(.2, 1.6, .4, 1); }
.scPool { flex: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.scPool.n4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.scPool.n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.scCard { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; padding: 8px 4px 6px; border: 0; border-radius: 18px; background: #fff; color: inherit; font: 800 clamp(.92rem, 2dvh, 1.06rem)/1.3 var(--display); box-shadow: 0 5px 0 var(--line); cursor: pointer; }
.scCardPic { width: 62px; width: clamp(56px, 10.6dvh, 92px); filter: drop-shadow(0 3px 3px rgba(27, 42, 74, .2)); }
.scCard.ok { visibility: hidden; }
.scCard.no { background: var(--noBg); box-shadow: 0 5px 0 var(--noD); animation: plNo .4s ease; }
.scCard:focus-visible, .scNode:focus-visible, .scHide:focus-visible, .scDecoy:focus-visible, .scGo:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.scRing { flex: none; display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--soft); font-weight: 700; font-size: .92rem; opacity: 0; transition: opacity .4s; }
.scRing.on { opacity: 1; }
.scLoop { width: 22px; height: 22px; border: 4px solid var(--okD); border-inline-start-color: transparent; border-radius: 50%; }
.scRing.on .scLoop { animation: scTurn 1.6s linear infinite; }
@keyframes scTurn { to { transform: rotate(360deg); } }

/* who eats whom */
.scWeb { flex: none; position: relative; align-self: center; width: min(100%, 420px); width: min(100%, clamp(280px, 56dvh, 470px)); aspect-ratio: 1; border-radius: 22px; background: linear-gradient(180deg, #E9F7FF 0 44%, #BCE3F7 44% 100%); box-shadow: 0 6px 0 var(--line); }
.scWeb svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.scWeb line { stroke: #E8A400; stroke-width: 1.5; stroke-linecap: round; animation: scDraw .5s ease-out both; }
@keyframes scDraw { from { opacity: 0; } to { opacity: 1; } }
.scNode { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; width: 21%; padding: 0; border: 0; background: none; color: var(--ink); font: 800 clamp(.74rem, 3vw, .9rem)/1.2 var(--display); cursor: pointer; }
.scNodePic { width: 76%; filter: drop-shadow(0 3px 3px rgba(27, 42, 74, .25)); }
.scNode.call .scNodePic { animation: arCall 1.1s ease-in-out infinite; }
.scNode.seen .scNodePic { filter: drop-shadow(0 0 5px #FFD23F); }

/* the one that hides */
.scSpot { flex: none; position: relative; align-self: center; width: min(100%, 440px); aspect-ratio: 1 / .8; border-radius: 22px; overflow: hidden; box-shadow: 0 6px 0 var(--line); }
.scSpot.g-sand { background: radial-gradient(circle at 20% 30%, rgba(190, 150, 90, .45) 0 10%, transparent 11%), radial-gradient(circle at 70% 60%, rgba(190, 150, 90, .4) 0 14%, transparent 15%), radial-gradient(circle at 45% 85%, rgba(170, 130, 80, .35) 0 9%, transparent 10%), linear-gradient(170deg, #EBCB90, #D9B173); }
.scSpot.g-grass { background: radial-gradient(circle at 25% 35%, rgba(70, 140, 60, .5) 0 12%, transparent 13%), radial-gradient(circle at 75% 70%, rgba(60, 130, 60, .5) 0 15%, transparent 16%), linear-gradient(170deg, #84C96A, #5CA84F); }
.scHide, .scDecoy { position: absolute; transform: translate(-50%, -50%); width: 21%; padding: 0; border: 0; background: none; cursor: pointer; }
.scHidePic { width: 100%; }
.scHide .scHidePic { filter: sepia(1) saturate(.75) hue-rotate(-6deg) brightness(.98); opacity: .8; transition: filter .4s, opacity .4s, transform .4s; }
.g-grass .scHide .scHidePic { filter: saturate(.9) brightness(.92); }
.scHide.found { z-index: 1; }
.scHide.found .scHidePic { filter: drop-shadow(0 0 6px #FFD23F); opacity: 1; transform: scale(1.3); }
.scDecoy.no { animation: plNo .4s ease; }
.scDecoy .scHidePic { filter: drop-shadow(0 2px 2px rgba(60, 40, 20, .3)); }

/* a row's other motions */
.arRow.in.fxshake .arPic { animation: scShook .5s ease-in-out 3; }
@keyframes scShook { 25% { transform: translate(-3px, 1px) rotate(-3deg); } 75% { transform: translate(3px, -1px) rotate(3deg); } }
.arRow.in.fxgo .arPic:first-child { animation: scGoBy 1.4s .3s ease-in-out both; }
@keyframes scGoBy { to { transform: translateX(-16px); } }

/* the plant makes its food: it stays as each stage leaves it */
.sc-photo .scSun, .sc-photo .scGas, .sc-photo .scFood, .sc-photo .scOxy { opacity: 0; transition: opacity .5s; }
.sc-photo .scDrops { opacity: 0; }
.sc-photo.s1 .scDrops { opacity: 1; }
.sc-photo.s1 .scDrops circle { animation: scUp 1.6s linear infinite; }
.sc-photo.s1 .scDrops circle:nth-child(2) { animation-delay: .53s; }
.sc-photo.s1 .scDrops circle:nth-child(3) { animation-delay: 1.06s; }
@keyframes scUp { 0% { transform: translateY(0); opacity: 0; } 15% { opacity: 1; } 80% { opacity: 1; } 100% { transform: translateY(-112px); opacity: 0; } }
.sc-photo.s2 .scSun { opacity: 1; }
.sc-photo.s3 .scGas { opacity: 1; transform: translate(26px, 26px); transition: opacity .4s, transform 1.4s ease-in; }
.sc-photo.s4 .scFood { opacity: .75; }
.sc-photo.s4 .scGas { opacity: 0; }
.sc-photo.s5 .scFood { opacity: 0; }
.sc-photo.s5 .scOxy { opacity: 1; }
.sc-photo.s5 .scOxy circle { animation: scOut 1.8s ease-out infinite; }
@keyframes scOut { 0% { transform: translateY(14px); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(-20px); opacity: 0; } }

/* the bee */
.sc-pollen .scBee { transform: translate(160px, 30px); transition: transform 1s ease-in-out; }
.sc-pollen.s1 .scBee { transform: translate(84px, 62px); }
.sc-pollen.s2 .scBee { transform: translate(236px, 62px); }
.sc-pollen.s3 .scBee { transform: translate(160px, 22px); }
.sc-pollen .scOnBee { opacity: 0; transition: opacity .4s .7s; }
.sc-pollen.s1 .scOnBee { opacity: 1; }
.sc-pollen.s2 .scOnBee { opacity: 0; }
.sc-pollen .scFruit { opacity: 0; transform-box: fill-box; transform-origin: center; transform: scale(.4); transition: opacity .6s .4s, transform .8s .4s; }
.sc-pollen.s3 .scFruit { opacity: 1; transform: none; }
.sc-pollen.s3 .scFlowerB { opacity: 0; transition: opacity .6s; }

/* the earthquake */
.sc-quake .scCrack { stroke-dasharray: 130; stroke-dashoffset: 130; transition: stroke-dashoffset .9s ease-out; }
.sc-quake.s1 .scCrack { stroke-dashoffset: 0; }
.sc-quake.s1 .scShake { animation: scShook .22s linear 6; }
.sc-quake.s1 .scPlateA { transform: translateX(-3px); transition: transform .5s; }
.sc-quake.s1 .scPlateB { transform: translate(3px, -3px); transition: transform .5s; }
.sc-quake.s2 .scShake { animation: scShook2 .2s linear 9; }
@keyframes scShook2 { 25% { transform: translate(-3px, 2px); } 75% { transform: translate(3px, -2px); } }
.sc-quake .scFall { transform-box: fill-box; transform-origin: 50% 100%; }
.sc-quake.s2 .scFall { transform: rotate(24deg) translateY(6px); transition: transform 1s 1s ease-in; }
.sc-quake.s2 .scPlateB { transform: translate(8px, -6px); transition: transform .6s; }

/* the volcano */
.sc-volcano .scPipe { stroke-dasharray: 100; stroke-dashoffset: 100; transition: stroke-dashoffset 1.4s ease-out; }
.sc-volcano.s1 .scPipe { stroke-dashoffset: 0; }
.sc-volcano .scFlow path { stroke-dasharray: 100; stroke-dashoffset: 100; transition: stroke-dashoffset 1.4s ease-in, stroke .8s; }
.sc-volcano.s2 .scFlow path { stroke-dashoffset: 0; }
.sc-volcano .scSmoke { opacity: 0; transition: opacity .6s; }
.sc-volcano.s2 .scSmoke { opacity: 1; }
.sc-volcano.s2 .scSmoke circle { animation: scPuff 2.2s ease-out infinite; }
@keyframes scPuff { 50% { transform: translateY(-5px) scale(1.04); } }
.sc-volcano .scCone2 { opacity: 0; transition: opacity 1.2s; }
.sc-volcano.s3 .scCone2 { opacity: 1; }
.sc-volcano.s3 .scFlow path { stroke: #4B4540; }

/* water in the rock's crack */
.sc-freeze .scRain, .sc-freeze .scWet, .sc-freeze .scFrozen, .sc-freeze .scSunny { opacity: 0; transition: opacity .5s; }
.sc-freeze .scHalfA, .sc-freeze .scHalfB { transition: transform .9s ease-out; }
.sc-freeze.s1 .scRain, .sc-freeze.s1 .scWet { opacity: 1; }
.sc-freeze.s2 .scRain, .sc-freeze.s2 .scWet { opacity: 0; }
.sc-freeze.s2 .scFrozen { opacity: 1; }
.sc-freeze.s2 .scHalfA { transform: translateX(-5px); }
.sc-freeze.s2 .scHalfB { transform: translateX(5px); }
.sc-freeze.s3 .scFrozen { opacity: 0; }
.sc-freeze.s3 .scWet { opacity: 1; }
.sc-freeze.s3 .scSunny { opacity: 1; }
.sc-freeze.s4 .scWet, .sc-freeze.s4 .scSunny { opacity: 0; }
.sc-freeze.s4 .scHalfA { transform: translateX(-26px) rotate(-6deg); transform-box: fill-box; transform-origin: 50% 100%; }
.sc-freeze.s4 .scHalfB { transform: translateX(26px) rotate(6deg); transform-box: fill-box; transform-origin: 50% 100%; }

/* the pieces go down and away */
.sc-erode .scBits { transition: transform 1.4s ease-in; }
.sc-erode.s1 .scBits { transform: translate(60px, 102px); }
.sc-erode.s2 .scBits { transform: translate(190px, 110px); transition-duration: 2s; transition-timing-function: ease-in-out; }
.sc-erode .scPile { opacity: 0; transform-box: fill-box; transform-origin: 100% 100%; transform: scale(.4); transition: opacity .6s, transform 1.2s; }
.sc-erode.s3 .scPile { opacity: 1; transform: none; }
.sc-erode.s3 .scBits { opacity: 0; transition: opacity .6s; }

/* water on sand and on clay */
.sc-water .scPourA, .sc-water .scPourB, .sc-water .scDrip, .sc-water .scCup { opacity: 0; transition: opacity .5s; }
.sc-water.s1 .scPourA, .sc-water.s1 .scPourB { opacity: 1; }
.sc-water.s2 .scPourA { opacity: 0; transition-duration: 1.4s; }
.sc-water.s2 .scDrip, .sc-water.s2 .scCup { opacity: 1; transition-delay: .4s; }

/* opening the rock */
.sc-dig .scCover1, .sc-dig .scCover2, .sc-dig .scCover3 { transition: transform .9s ease-in, opacity .7s .2s; }
.sc-dig.s1 .scCover1, .sc-dig.s2 .scCover2, .sc-dig.s3 .scCover3 { transform: translateY(-60px); opacity: 0; }
.sc-dig.s3 .scFossil { animation: scGlow 1.6s ease-in-out 2; }
@keyframes scGlow { 50% { filter: drop-shadow(0 0 7px #FFD23F); } }

@media (prefers-reduced-motion: reduce) {
  .scTag, .scMini, .scGo, .scCard.no, .scNode.call .scNodePic, .scRing.on .scLoop, .arRow.in.fxshake .arPic, .arRow.in.fxgo .arPic:first-child,
  .sc-photo.s1 .scDrops circle, .sc-photo.s5 .scOxy circle, .sc-quake.s1 .scShake, .sc-quake.s2 .scShake, .sc-volcano.s2 .scSmoke circle, .sc-dig.s3 .scFossil { animation: none; }
  .sc-photo.s1 .scDrops circle:nth-child(2) { transform: translateY(-40px); }
  .sc-photo.s1 .scDrops circle:nth-child(3) { transform: translateY(-80px); }
}
