/* Quiet brand motion, loaded after the shared theme. No hidden content or navigation delays. */
.otr-ambient-rice {
  position: fixed;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  contain: strict;
  pointer-events: none;
  user-select: none;
}
.otr-rice-edge {
  position: absolute;
  inset-block: 0;
  width: 32px;
  overflow: hidden;
  contain: strict;
  pointer-events: none;
}
.otr-rice-edge--left { left: 0; }
.otr-rice-edge--right { right: 0; }
.otr-floating-rice {
  position: absolute;
  box-sizing: border-box;
  width: 5.88px;
  height: 17.64px;
  border: .588px solid #ad793dc9;
  border-radius: 65% 40% 60% 45%;
  background: linear-gradient(110deg, #fffdf8 15%, #f5dfb3 64%, #d6aa66);
  box-shadow: .588px 1.176px 1.764px #6c421025;
  opacity: .41;
  animation: otr-rice-drift var(--rice-duration, 15.3s) ease-in-out var(--rice-delay, 0s) infinite alternate;
}
.otr-floating-rice::after {
  content: '';
  position: absolute;
  inset: 2.352px 1.764px;
  border-left: .588px solid #fffdf8c4;
  border-radius: 50%;
}
.otr-floating-rice--left { left: 9px; }
.otr-floating-rice--right { right: 9px; }
.otr-floating-rice--gold {
  background: linear-gradient(115deg, #ffe2a2, #e8ab50);
  border-color: #b47c30;
}
@keyframes otr-rice-drift {
  0% { transform: translate3d(0, 42px, 0) rotate(var(--rice-tilt)); opacity: .38; }
  50% { opacity: .47; }
  100% { transform: translate3d(var(--rice-current-sway, var(--rice-sway)), -42px, 0) rotate(calc(var(--rice-tilt) + 12deg)); opacity: .41; }
}
html[data-otr-ambient-motion='paused'] .otr-ambient-rice { visibility: hidden; }
html[data-otr-ambient-motion='paused'] .otr-floating-rice { animation-play-state: paused; }
body:has(dialog[open], [role='dialog'][aria-modal='true']:not(dialog):not([hidden]):not([aria-hidden='true']):not([data-state='closed'])) .otr-ambient-rice { visibility: hidden; }
body:has(dialog[open], [role='dialog'][aria-modal='true']:not(dialog):not([hidden]):not([aria-hidden='true']):not([data-state='closed'])) .otr-floating-rice { animation-play-state: paused; }

body[data-otr-omega] .otr-background-motion-controls {
  box-sizing: border-box;
  max-width: 100%;
  flex-wrap: wrap;
  display: flex;
  justify-content: center;
  flex: 1 0 100%;
  width: 100%;
  padding: 12px 16px 4px;
}
body[data-otr-omega] .otr-background-motion-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
  max-width: 100%;
  padding: 9px 15px;
  color: #595044;
  background: #fffdf8;
  border: 1px solid #e3dacb;
  border-radius: 999px;
  font: 12px/1.35 Arial, Helvetica, sans-serif;
  cursor: pointer;
}
body[data-otr-omega] .otr-background-motion-toggle:focus-visible {
  outline: 3px solid #a83c08;
  outline-offset: 4px;
}
body[data-otr-omega] .otr-background-motion-toggle:disabled { cursor: default; }
.otr-background-motion-icon {
  display: inline-block;
  width: 5px;
  height: 12px;
  flex: none;
  border: 1px solid #a66d2d;
  border-radius: 60%;
  background: #f8e5c1;
  transform: rotate(28deg);
}
.otr-background-motion-toggle[aria-pressed='false'] .otr-background-motion-icon { background: transparent; }

/* Native page snapshots give both outgoing and incoming pages a soft crossfade.
   Links, anchors, forms, history and modifier-clicks retain normal browser behavior. */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition { pointer-events: none; }
  ::view-transition-group(root) { animation-duration: 620ms; }
  ::view-transition-old(root) {
    animation: otr-ambient-page-out 420ms cubic-bezier(.22, .61, .36, 1) both;
    mix-blend-mode: normal;
  }
  ::view-transition-new(root) {
    animation: otr-ambient-page-in 620ms cubic-bezier(.16, 1, .3, 1) both;
    mix-blend-mode: normal;
  }
  /* Older engines keep instant navigation. This tiny arrival is never a loading curtain. */
  @supports not (view-transition-name: root) {
    body[data-otr-omega] > main { animation: otr-ambient-arrival 420ms ease-out; }
  }
}
@keyframes otr-ambient-page-out { to { opacity: 0; } }
@keyframes otr-ambient-page-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes otr-ambient-arrival { from { opacity: .94; } to { opacity: 1; } }

@media (max-width: 760px) {
  .otr-rice-edge { width: 16px; }
  .otr-floating-rice { width: 4.704px; height: 14.112px; --rice-current-sway: 0px; }
  .otr-floating-rice--left { left: 4px; }
  .otr-floating-rice--right { right: 4px; }
  .otr-floating-rice--desktop-only { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  .otr-ambient-rice { display: none; }
  .otr-floating-rice { animation: none !important; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none !important; }
  body[data-otr-omega] > main { animation: none !important; }
}
@media print {
  .otr-ambient-rice, .otr-background-motion-controls { display: none !important; }
}
