/* Motion layer on the existing ELAK product.
   Brand stays paper + terra + leaf. Layout and copy stay.
   MOTION_INTENSITY 6: press feedback, drifting grid, slow color wash.
   z-index: 0 ambient, 1 grid, 2 app and report content. */

.ambient-field {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.ambient-field span {
  position: absolute;
  width: 46vw;
  height: 46vw;
  min-width: 280px;
  min-height: 280px;
  border-radius: 50%;
  filter: blur(46px);
  will-change: transform;
  animation: ambient-drift 26s cubic-bezier(0.45, 0, 0.55, 1) infinite alternate;
}

.ambient-field span:nth-child(1) {
  top: -12%;
  left: -8%;
  background: radial-gradient(circle, rgba(95, 125, 98, 0.34), transparent 68%);
}

.ambient-field span:nth-child(2) {
  right: -10%;
  bottom: -16%;
  background: radial-gradient(circle, rgba(166, 132, 61, 0.28), transparent 70%);
  animation-duration: 34s;
  animation-delay: -8s;
}

.ambient-field span:nth-child(3) {
  top: 28%;
  left: 38%;
  background: radial-gradient(circle, rgba(111, 88, 64, 0.16), transparent 68%);
  animation-duration: 22s;
  animation-delay: -4s;
}

@keyframes ambient-drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(7vw, 5vh, 0) scale(1.12); }
}

.shape-grid {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, transparent 8%, rgba(0, 0, 0, 0.22) 16%, #000 26%, #000 58%, rgba(0, 0, 0, 0.4) 80%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, transparent 8%, rgba(0, 0, 0, 0.22) 16%, #000 26%, #000 58%, rgba(0, 0, 0, 0.4) 80%, transparent 100%);
}

.shapegrid-canvas {
  width: 100%;
  height: 100%;
  display: block;
  animation: grid-breathe 12s ease-in-out infinite alternate;
}

@keyframes grid-breathe {
  from { opacity: 0.62; }
  to { opacity: 1; }
}

#app,
.content {
  position: relative;
  z-index: 2;
}

/* Report copy sits in the page flow, so keep a paper field under it.
   The drifting grid stays in the margins. */
.content {
  background: #f4efe4;
}

button,
a.ghost,
.choice,
.mode,
.tab,
.ai-box__btn,
.backlink--x {
  transition:
    transform 180ms cubic-bezier(0.16, 1, 0.3, 1),
    background-color 180ms cubic-bezier(0.16, 1, 0.3, 1),
    border-color 180ms cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

button:active:not(:disabled):not(#hold),
a.ghost:active,
.choice:active,
.mode:active,
.tab:active,
.ai-box__btn:active:not(:disabled),
.backlink--x:active {
  transform: translateY(1px) scale(0.98);
}

[data-press-pos="1"] { position: relative; }

.is-pressing { overflow: hidden; }

.press-ripple {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  background: rgba(111, 88, 64, 0.22);
  transform: scale(0.15);
  opacity: 0.75;
  animation: press-ripple 480ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.primary > .press-ripple,
.tab.sel > .press-ripple,
.secondary.sel > .press-ripple,
#hold > .press-ripple {
  background: rgba(247, 241, 230, 0.38);
}

@keyframes press-ripple {
  to { transform: scale(1); opacity: 0; }
}

.ptable tbody tr {
  transition: background-color 160ms cubic-bezier(0.16, 1, 0.3, 1);
}

.ptable tbody tr:active {
  background: rgba(95, 125, 98, 0.28);
}

@media (prefers-reduced-motion: reduce) {
  .ambient-field span,
  .shapegrid-canvas,
  .press-ripple {
    animation: none;
  }

  button,
  a.ghost,
  .choice,
  .mode,
  .tab,
  .ai-box__btn,
  .backlink--x,
  .ptable tbody tr {
    transition: none;
  }

  button:active:not(:disabled):not(#hold),
  a.ghost:active,
  .choice:active,
  .mode:active,
  .tab:active,
  .ai-box__btn:active:not(:disabled),
  .backlink--x:active {
    transform: none;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .ambient-field { display: none; }
  .shapegrid-canvas { animation: none; opacity: 0.85; }
}
