/* ---------- The ONE expand mark and the calm first-time nudges (public/nudge.js) ----------
   Owner 2026-11-17: "The little plus symbols next to details can we make them pulse so they become a little bit larger
   sort of like a nudge ... to let people know that they can click and expand details" and "I don't like Chevron's".
   A small round glass "+" at the right end of a <summary class="xm-sum">; it turns into "-" when the <details> opens.
   Timing tokens (--t-change ...) and the one easing curve (--ease) come from the end of portal.css.
   No chevrons, no red, no black. Everything here is switched off under prefers-reduced-motion (see the end). */

.xm-sum { list-style: none; cursor: pointer; position: relative; -webkit-tap-highlight-color: transparent; }
.xm-sum::-webkit-details-marker { display: none; }
.xm-sum:focus-visible { outline: 3px solid var(--script); outline-offset: 2px; border-radius: 12px; }
.step-more > summary { min-height: 48px; gap: 10px; }
.step-more > summary strong { flex: 1; min-width: 0; }
.thread-sum .xm { grid-column: 5; }
.thread-sum .thread-dot { grid-column: 4; }

.xm {
  --xm-ink: var(--script, #6A5546);
  flex: none; margin-left: auto; position: relative; width: 28px; height: 28px; border-radius: 999px;
  border: 1px solid rgba(106, 85, 70, 0.28);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.85), rgba(239, 232, 222, 0.55));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), 0 1px 2px rgba(33, 31, 32, 0.10);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  /* "scale" (the pulse) and "rotate" (open) are their own properties, so they never fight each other */
  transition: rotate var(--t-change) var(--ease), box-shadow var(--t-change) var(--ease);
}
.xm::before, .xm::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 12px; height: 2px; margin: -1px 0 0 -6px; border-radius: 2px;
  background: var(--xm-ink); transition: transform var(--t-change) var(--ease);
}
.xm::after { transform: rotate(90deg) scaleX(1); }
details[open] > .xm-sum .xm { rotate: 180deg; }
details[open] > .xm-sum .xm::after { transform: rotate(90deg) scaleX(0); }
@media (hover: hover) { .xm-sum:hover .xm { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), 0 2px 6px rgba(33, 31, 32, 0.16); } }

/* the pulse: grows to 1.18 and settles, 1.6 s a breath, TWICE, then stops (never a loop) */
.xm-breathe { animation: xm-breathe 1.6s var(--ease) 2 both; }
@keyframes xm-breathe {
  0%, 100% { scale: 1; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), 0 1px 2px rgba(33, 31, 32, 0.10), 0 0 0 0 rgba(106, 85, 70, 0); }
  45% { scale: 1.18; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), 0 1px 2px rgba(33, 31, 32, 0.10), 0 0 0 6px rgba(106, 85, 70, 0.13); }
}

/* the first look at a swipe deck: the top card leans left, then right, then settles, once */
.deck-card.nudge-lean { animation: deck-lean 2.4s var(--ease) 1 both; }
@keyframes deck-lean {
  0%, 100% { translate: 0 0; rotate: 0deg; }
  28% { translate: -14px 0; rotate: -1.2deg; }
  64% { translate: 14px 0; rotate: 1.2deg; }
}

/* the floating round "+": one soft breath the first time a client lands on a page */
.compose-fab.nudge-fab { animation: fab-nudge 2.2s var(--ease) 1 both; }
@keyframes fab-nudge {
  0%, 100% { scale: 1; filter: drop-shadow(0 0 0 rgba(46, 125, 85, 0)); }
  45% { scale: 1.12; filter: drop-shadow(0 0 9px rgba(46, 125, 85, 0.45)); }
}

/* the home "Your next step" main button: one soft green glow when it scrolls into view */
.nudge-glow { animation: next-glow 2s var(--ease) 1 both; }
@keyframes next-glow {
  0%, 100% { outline: 0 solid rgba(46, 125, 85, 0); outline-offset: 0; }
  50% { outline: 7px solid rgba(46, 125, 85, 0.22); outline-offset: 2px; }
}

/* reduced motion: no pulse, no peek, no glow. The mark just shows a soft glass ring (until the person has opened one). */
@media (prefers-reduced-motion: reduce) {
  .xm-breathe, .deck-card.nudge-lean, .compose-fab.nudge-fab, .nudge-glow { animation: none; }
  .xm, .xm::before, .xm::after { transition: none; }
  html:not(.dd-learned) .xm { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), 0 1px 2px rgba(33, 31, 32, 0.10), 0 0 0 4px rgba(106, 85, 70, 0.14); }
}
