/* ─────────────────────────────────────────────────────────────
   Page 20 — Motion Lab (recipes, not principles)
   ───────────────────────────────────────────────────────────── */

/* Recipe card grid */
.recipes {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
@media (max-width: 900px) { .recipes { grid-template-columns: 1fr; } }
.recipe {
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  background: rgba(255,255,255,0.02);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.recipe .stage {
  position: relative;
  height: 260px;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 100% at 50% 50%, rgba(47,55,255,0.16), transparent 60%),
    linear-gradient(180deg, #000000, #050818);
  border-bottom: 1px solid var(--border-subtle);
  display: grid;
  place-items: center;
  isolation: isolate;
}
.recipe .stage::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.5) 0.5px, transparent 0.5px);
  background-size: 100px 100px;
  opacity: 0.35;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black, transparent 85%);
  pointer-events: none;
}
.recipe .stage > * { position: relative; z-index: 1; }
.recipe .info {
  padding: 22px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.recipe .info .ix {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue-300);
}
.recipe .info h4 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.012em;
  margin: 0;
  color: var(--fg-default);
}
.recipe .info p {
  font-size: 13px;
  color: var(--fg-secondary);
  line-height: 1.55;
  margin: 0;
}
.recipe .info .specs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.recipe .info .specs span {
  padding: 4px 9px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--fg-muted);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.02);
}

/* === Recipe 01 — page shell entrance === */
.r-shell .layers {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 70%;
  max-width: 320px;
}
.r-shell .layer {
  height: 22px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 3px;
  opacity: 0;
  transform: translateY(8px);
  animation: shellSettle 5s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}
.r-shell .layer:nth-child(1) { animation-delay: 0.1s; }
.r-shell .layer:nth-child(2) { animation-delay: 0.3s; height: 14px; }
.r-shell .layer:nth-child(3) { animation-delay: 0.5s; }
.r-shell .layer:nth-child(4) { animation-delay: 0.7s; height: 38px; }
.r-shell .layer:nth-child(5) { animation-delay: 0.9s; }
@keyframes shellSettle {
  0%, 8% { opacity: 0; transform: translateY(8px); }
  25%, 78% { opacity: 1; transform: translateY(0); }
  92%, 100% { opacity: 0; transform: translateY(-4px); }
}

/* === Recipe 02 — domain transition === */
.r-domain svg { width: 80%; height: 70%; overflow: visible; }
.r-domain .planet {
  fill: rgba(255,255,255,0.16);
  transform-origin: center;
  animation: domainPan 6s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}
.r-domain .planet.active {
  fill: #FFFFFF;
  filter: drop-shadow(0 0 8px rgba(133,160,255,0.5));
  animation: domainPanActive 6s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}
.r-domain .orbit {
  fill: none;
  stroke: rgba(133,160,255,0.32);
  stroke-width: 1;
}
@keyframes domainPan {
  0%, 100% { transform: translateX(0) scale(1); }
  50% { transform: translateX(-12px) scale(0.92); opacity: 0.6; }
}
@keyframes domainPanActive {
  0%, 100% { transform: translateX(0) scale(1); }
  50% { transform: translateX(40px) scale(1.15); }
}

/* === Recipe 03 — Emma reading the room === */
.r-reading svg { width: 70%; height: 70%; overflow: visible; }
.r-reading .ring {
  fill: none;
  stroke: rgba(133,160,255,0.4);
  stroke-width: 1;
  transform-origin: center;
  transform-box: fill-box;
  animation: spin 20s linear infinite;
}
.r-reading .ring.r2 {
  animation: spin 14s linear infinite reverse;
  stroke: rgba(195,179,255,0.32);
}
.r-reading .core {
  fill: #FFFFFF;
  animation: readingPulse 3s ease-in-out infinite;
}
.r-reading .label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  fill: var(--blue-300);
  text-anchor: middle;
  opacity: 0;
  animation: readingLabel 3s ease-in-out infinite;
}
@keyframes readingPulse {
  0%, 100% { opacity: 0.5; transform: scale(0.85); transform-origin: center; transform-box: fill-box; }
  50% { opacity: 1; transform: scale(1.15); }
}
@keyframes readingLabel {
  0%, 30% { opacity: 0; }
  50% { opacity: 1; }
  70%, 100% { opacity: 0; }
}

/* === Recipe 04 — decision commit === */
.r-commit {
  position: relative;
  width: 60%;
  max-width: 280px;
}
.r-commit .button {
  padding: 14px 22px;
  background: #FFFFFF;
  color: #000;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  position: relative;
  animation: commitPress 4s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}
.r-commit .button::after {
  content: "✓ Committed";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--blue-300);
  color: #050818;
  border-radius: 4px;
  opacity: 0;
  animation: commitConfirm 4s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}
@keyframes commitPress {
  0%, 30% { transform: scale(1); }
  40% { transform: scale(0.96); }
  60%, 80% { transform: scale(1); }
}
@keyframes commitConfirm {
  0%, 38% { opacity: 0; }
  42% { opacity: 1; }
  78% { opacity: 1; }
  82%, 100% { opacity: 0; }
}

/* === Recipe 05 — chain progression === */
.r-chain svg { width: 90%; height: 60px; overflow: visible; }
.r-chain .track {
  stroke: rgba(255,255,255,0.18);
  stroke-width: 1;
  stroke-dasharray: 3 4;
  fill: none;
}
.r-chain .progress {
  stroke: #FFFFFF;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  fill: none;
  animation: chainProgression 6s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}
.r-chain .node {
  fill: rgba(255,255,255,0.16);
  transition: fill 200ms ease;
}
.r-chain .node-pulse {
  fill: #69FDF8;
  filter: drop-shadow(0 0 8px rgba(105,253,248,0.7));
  opacity: 0;
  animation: chainPulse 6s linear infinite;
}
@keyframes chainProgression {
  0% { stroke-dashoffset: 1000; }
  60% { stroke-dashoffset: 600; }
  90% { stroke-dashoffset: 600; }
  100% { stroke-dashoffset: 1000; }
}
@keyframes chainPulse {
  0%, 100% { opacity: 0; transform: translateX(0); }
  20% { opacity: 1; transform: translateX(60px); }
  40% { opacity: 1; transform: translateX(120px); }
  60% { opacity: 1; transform: translateX(180px); }
  80% { opacity: 0; transform: translateX(180px); }
}

/* === Recipe 06 — hero orbit choreography === */
.r-orbit svg { width: 80%; height: 80%; overflow: visible; }
.r-orbit .o-glow {
  fill: rgba(86,106,255,0.16);
  animation: orbitPulse 5s ease-in-out infinite;
}
.r-orbit .o-ring {
  fill: none;
  stroke-width: 1;
  transform-origin: center;
  transform-box: fill-box;
}
.r-orbit .o-ring.r1 { stroke: rgba(133,160,255,0.4); animation: spin 28s linear infinite; }
.r-orbit .o-ring.r2 { stroke: rgba(195,179,255,0.32); animation: spin 20s linear infinite reverse; }
.r-orbit .o-ring.r3 { stroke: rgba(105,253,248,0.24); animation: spin 14s linear infinite; }
.r-orbit .o-dot {
  fill: #FFFFFF;
}
@keyframes orbitPulse {
  0%, 100% { opacity: 0.6; r: 50; }
  50% { opacity: 1; r: 65; }
}

/* Reduced motion: pause all loops */
@media (prefers-reduced-motion: reduce) {
  .r-shell .layer,
  .r-domain .planet,
  .r-domain .planet.active,
  .r-reading .ring, .r-reading .core, .r-reading .label,
  .r-commit .button, .r-commit .button::after,
  .r-chain .progress, .r-chain .node-pulse,
  .r-orbit .o-glow, .r-orbit .o-ring {
    animation: none !important;
  }
  .r-shell .layer { opacity: 1; transform: none; }
  .r-commit .button::after { opacity: 0; }
}

/* Timeline table */
.recipe-timeline {
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  overflow: hidden;
}
.recipe-timeline .row {
  display: grid;
  grid-template-columns: 140px 100px 1fr 120px;
  align-items: center;
  padding: 14px 22px;
  border-bottom: 1px solid var(--border-subtle);
  gap: 22px;
}
.recipe-timeline .row:last-child { border-bottom: 0; }
@media (max-width: 820px) {
  .recipe-timeline .row { grid-template-columns: 1fr 1fr; gap: 8px; }
  .recipe-timeline .row .use { grid-column: 1 / -1; }
  .recipe-timeline .row .easing { grid-column: 1 / -1; text-align: left !important; }
}
.recipe-timeline .row.head {
  background: rgba(255,255,255,0.025);
  padding: 12px 22px;
}
.recipe-timeline .row.head > div {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.recipe-timeline .name {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--fg-default);
}
.recipe-timeline .dur {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--blue-300);
}
.recipe-timeline .use {
  font-size: 13px;
  color: var(--fg-secondary);
  line-height: 1.5;
}
.recipe-timeline .easing {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--fg-muted);
  text-align: right;
  text-transform: uppercase;
}
