.grant-scene {
    gap: 12px;
    padding-block: 16px 20px;
  }
  .auth-art-side .scene-stage {
    width: min(360px, 74vw);
  }
}
@media (max-width: 480px) {
  .auth-form-side {
    padding: 18px 20px 8px;
    gap: 20px;
  }
  .auth-art-side {
    min-height: 230px;
    padding-bottom: 12px;
  }
  .auth-art-side .scene-stage {
    width: min(300px, 74vw);
  }
}

.grant-scene {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  min-width: 0;
  padding: 32px 24px;
  gap: 24px;
  --cycle: 9s;
}
.scene-stage {
  position: relative;
  width: min(500px, 38vw);
  aspect-ratio: 1;
  flex-shrink: 0;
}
.scene-canvas {
  position: absolute;
  inset: 0 auto auto 0;
  width: 500px;
  height: 500px;
  perspective: 1400px;
  transform: scale(var(--scene-scale, 1));
  transform-origin: top left;
}
.scene-stack {
  position: absolute;
  inset: 40px;
  transform-style: preserve-3d;
  transform: rotateX(54deg) rotateZ(-36deg);
  animation: scene-float 6s ease-in-out infinite;
}
@keyframes scene-float {
  0%,
  100% {
    transform: rotateX(54deg) rotateZ(-36deg) translateZ(0);
  }
  50% {
    transform: rotateX(54deg) rotateZ(-36deg) translateZ(14px);
  }
}
.sheet {
  position: absolute;
  inset: 0;
  border: 1px solid color-mix(in oklab, var(--foreground) 14%, transparent);
  border-radius: 14px;
  background: var(--card);
  box-shadow: 0 1px 0 rgb(255 255 255 / 0.6) inset;
}
.sheet-back {
  transform: translateZ(-56px);
  background:
    repeating-linear-gradient(
      0deg,
      transparent 0 22px,
      color-mix(in oklab, var(--foreground) 6%, transparent) 22px 23px
    ),
    var(--card);
}
.sheet-mid {
  transform: translateZ(-28px);
  padding: 30px 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.source-line {
  display: block;
  height: 8px;
  width: calc(var(--w) * 100%);
  border-radius: 4px;
  background: color-mix(in oklab, var(--foreground) 10%, transparent);
  animation: source-glow var(--cycle) ease-in-out infinite;
  animation-delay: calc(var(--i) * 0.7s);
}
@keyframes source-glow {
  0%,
  10%,
  30%,
  100% {
    background: color-mix(in oklab, var(--foreground) 10%, transparent);
  }
  18% {
    background: #e2b65a;
  }
}
.sheet-front {
  padding: 24px 26px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow:
    0 30px 60px -20px rgb(74 26 61 / 0.25),
    0 1px 0 rgb(255 255 255 / 0.6) inset;
}
.sheet-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}
.sheet-seal {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--primary);
}
.sheet-title {
  height: 10px;
  width: 55%;
  border-radius: 5px;
  background: color-mix(in oklab, var(--foreground) 22%, transparent);
}
.sheet-field {
  display: grid;
  gap: 5px;
}
.field-label {
  height: 6px;
  width: 30%;
  border-radius: 3px;
  background: color-mix(in oklab, var(--foreground) 14%, transparent);
}
.field-box {
  position: relative;
  display: block;
  height: 22px;
  border: 1px solid color-mix(in oklab, var(--foreground) 14%, transparent);
  border-radius: 6px;
  overflow: hidden;
}
.field-fill {
  position: absolute;
  inset-block: 7px;
  inset-inline-start: 8px;
  width: 0;
  border-radius: 4px;
  background: color-mix(in oklab, var(--primary) 70%, transparent);
  animation: field-fill var(--cycle) cubic-bezier(0.65, 0, 0.35, 1) infinite;
  animation-delay: calc(var(--i) * 0.45s);
}
@keyframes field-fill {
  0%,
  6% {
    width: 0;
  }
  16%,
  84% {
    width: calc(var(--w) * (100% - 40px));
  }
  94%,
  100% {
    width: 0;
  }
}
.field-check {
  position: absolute;
  inset-inline-end: 6px;
  top: 3px;
  width: 14px;
  height: 14px;
  color: #3a7330;
  opacity: 0;
  transform: scale(0.4);
  animation: field-check var(--cycle) cubic-bezier(0.34, 1.56, 0.64, 1) infinite;
  animation-delay: calc(var(--i) * 0.45s);
}
@keyframes field-check {
  0%,
  16% {
    opacity: 0;
    transform: scale(0.4);
  }
  20%,
  84% {
    opacity: 1;
    transform: scale(1);
  }
  92%,
  100% {
    opacity: 0;
    transform: scale(0.4);
  }
}
.sheet-stamp {
  position: absolute;
  inset-inline-end: 22px;
  bottom: 18px;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 2px solid var(--primary);
  border-radius: 999px;
  color: var(--primary);
  opacity: 0;
  animation: stamp var(--cycle) cubic-bezier(0.34, 1.56, 0.64, 1) infinite;
}
.sheet-stamp .receive-mark {
  width: 30px;
  height: 30px;
}
@keyframes stamp {
  0%,
  46% {
    opacity: 0;
    transform: translateZ(80px) scale(1.8) rotate(-18deg);
  }
  52% {
    opacity: 1;
    transform: translateZ(0) scale(0.92) rotate(-8deg);
  }
  56%,
  84% {
    opacity: 1;
    transform: translateZ(0) scale(1) rotate(-8deg);
  }
  94%,
  100% {
    opacity: 0;
    transform: translateZ(0) scale(1) rotate(-8deg);
  }
}

/* The platform's grant form animation, sized for the landing page. */
.grant-scene { padding: 0; gap: 0; }
.scene-stage { width: 80%; max-width: 500px; }
.scene-canvas { --scene-scale: .65; }
.sheet-stamp .receive-mark { width: 30px; height: 30px; }
.receive-mark { width: 30px; height: 30px; flex: none; overflow: visible; color: var(--primary); }
.mark-bang { transform-box: fill-box; transform-origin: 50% 100%; }
.brand:hover .mark-bang, .brand:focus-visible .mark-bang { animation: mark-hop .6s cubic-bezier(.34,1.56,.64,1); }
@keyframes mark-hop { 0%,100% { transform: translateY(0) rotate(0); } 40% { transform: translateY(-22%) rotate(-12deg); } 70% { transform: translateY(0) rotate(4deg); } }
.hero-copy { animation: enter .7s cubic-bezier(.22,1,.36,1) both; }
@keyframes enter { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.line-motif i { transition: width .5s cubic-bezier(.22,1,.36,1); }
.principle:hover .line-motif i { width: 100%; }
.citation-motif span:first-child { transition: transform .4s; }
.principle:hover .citation-motif span:first-child { transform: translateX(5px); }
.check-motif { transition: transform .4s; }
.principle:hover .check-motif { transform: rotate(-10deg); }


.grant-folder { animation: folder-browse 9s cubic-bezier(.4,0,.2,1) infinite; animation-delay: calc(var(--folder) * -3s); }
.folder-paper { animation: paper-browse 9s cubic-bezier(.4,0,.2,1) infinite; animation-delay: calc(var(--folder) * -3s); }
.folder-front { animation: folder-open 9s cubic-bezier(.4,0,.2,1) infinite; animation-delay: calc(var(--folder) * -3s); }
.library-track span { animation: library-scan 3s ease-in-out infinite; }
@keyframes folder-browse {
  0%, 30%, 100% { transform: translateX(var(--offset)) translateY(0) rotate(var(--angle)); z-index: 1; }
  8%, 23% { transform: translateX(var(--offset)) translateY(-23px) rotate(var(--angle)); z-index: 4; }
}
@keyframes paper-browse { 0%,30%,100% { transform: translateY(0); } 10%,22% { transform: translateY(-56px); } }
@keyframes folder-open { 0%,30%,100% { transform: rotateX(0); } 8%,24% { transform: rotateX(-24deg); } }
@keyframes library-scan { 0%,100% { transform: translateX(-45px); } 80% { transform: translateX(160px); } }
@supports (animation-timeline: view()) {
  .principle > div:first-of-type { animation: principle-enter linear both; animation-timeline: view(); animation-range: entry 0% entry 85%; }
  @keyframes principle-enter { from { opacity: .25; transform: translateY(22px); } to { opacity: 1; transform: none; } }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .field-fill { width: calc(var(--w) * (100% - 40px)); }
  .field-check, .sheet-stamp { opacity: 1; transform: none; }
}
