/* Motion vocabulary. Feedback is quicker than navigation; nothing bounces. */
:root {
  --ri-ease-out: cubic-bezier(.2, .72, .25, 1);
  --ri-ease-inout: cubic-bezier(.4, 0, .2, 1);
  --ri-fast: 120ms;
  --ri-control: 180ms;
  --ri-panel: 240ms;
  --ri-page: 300ms;
}

/* The filled pill, selected segment and search rule change in place. */
.pill, .view-switch a {
  transition: background-color var(--ri-control) var(--ri-ease-out),
              color var(--ri-control) var(--ri-ease-out),
              border-color var(--ri-control) var(--ri-ease-out);
}
#filterButton[aria-expanded="true"] { background-color: var(--signal); }
#filterForm {
  transition: border-color var(--ri-control) var(--ri-ease-out);
}
#filterForm:focus-within { border-color: var(--ink); }
#searchInput::placeholder { transition: opacity var(--ri-control) var(--ri-ease-out); }
#searchInput:focus::placeholder { opacity: .6; }

/* Fade the underline, retaining natural wrapping, line height, and hit areas. */
.grid-caption, .index-name, .reading-row h2, .detail-steps a span, .site-footer a,
.category-option > span:first-child, .gallery-shot summary, .cover-attribution summary {
  text-decoration: underline solid transparent 1px;
  text-underline-offset: .14em;
  transition: text-decoration-color var(--ri-control) var(--ri-ease-out);
}
.category-option[aria-pressed="true"] > span:first-child { text-decoration-color: var(--ink); }
.index-arrow, .reading-arrow, .detail-steps small, .filter-reading span {
  transition: transform var(--ri-control) var(--ri-ease-out);
}
.filter-reading span { display: inline-block; }
.fact-row a, .gallery-shot a, .filter-reading, .empty-state button, #catalogContext button {
  transition: text-decoration-color var(--ri-control) var(--ri-ease-out);
}
.landing-brand a, .interior-brand {
  transition: opacity var(--ri-fast) var(--ri-ease-out);
}
.landing-brand a:active, .interior-brand:active { opacity: .92; }

@media (hover: hover) and (pointer: fine) {
  .robot-card:hover .grid-caption, .index-row:hover .index-name,
  .reading-row:hover h2, .detail-steps a:hover span, .site-footer a:hover,
  .category-option:hover > span:first-child, .gallery-shot summary:hover,
  .cover-attribution summary:hover { text-decoration-color: var(--ink); }
  .index-row:hover .index-arrow, .reading-row:hover .reading-arrow,
  .filter-reading:hover span { transform: translate(1px, -1px); }
  .detail-steps a[data-step="-1"]:hover small { transform: translateX(-2px); }
  .detail-steps a[data-step="1"]:hover small { transform: translateX(2px); }
  .fact-row a:hover, .gallery-shot a:hover, .filter-reading:hover,
  .empty-state button:hover, #catalogContext button:hover { text-decoration-color: currentColor; }
}
/* Remove desktop hover feedback latched by some touch browsers. */
@media (hover: none) {
  .pill:hover { background: transparent; }
  .pill.index-jump:hover { background: rgba(251,247,245,.78); }
  .view-switch a:not([aria-current]):hover { background: transparent; }
  .robot-card:hover .grid-caption, .index-row:hover .index-name, .reading-row:hover h2,
  .detail-steps a:hover span, .site-footer a:hover { text-decoration-color: transparent; }
}
.pill:active, .view-switch a:not([aria-current]):active { background-color: var(--signal); }
.robot-card:focus-visible .grid-caption, .index-row:focus-visible .index-name,
.reading-row:focus-visible h2, .detail-steps a:focus-visible span, .site-footer a:focus-visible,
.category-option:focus-visible > span:first-child,
.gallery-shot summary:focus-visible, .cover-attribution summary:focus-visible {
  text-decoration-color: var(--ink);
}
.skip-link { transition: transform var(--ri-fast) var(--ri-ease-out); }

/* Large photos can reveal once decoded. No zoom or scroll-driven card entrances. */
:is(#coverImage, #detailImage)[data-media-ready="loading"] { opacity: 0; }
:is(#coverImage, #detailImage)[data-media-ready="ready"] {
  opacity: 1;
  transition: opacity var(--ri-panel) var(--ri-ease-out);
}

@media (prefers-reduced-motion: reduce) {
  :root { --ri-fast: 0ms; --ri-control: 0ms; --ri-panel: 0ms; --ri-page: 0ms; }
  .index-row:hover .index-arrow, .reading-row:hover .reading-arrow,
  .detail-steps a[data-step]:hover small, .filter-reading:hover span { transform: none; }
  :is(#coverImage, #detailImage)[data-media-ready="loading"] { opacity: 1; }
}
