/* Restrained, global feedback for controls and genuinely linked cards. */
:where(
  .button,
  .text-link,
  .nav-trigger,
  .menu-toggle,
  [data-linked-card],
  .editorial-grid article:has(a:not([aria-disabled="true"])),
  .list-rows article:has(a:not([aria-disabled="true"])),
  .photo-credits figure:has(a:not([aria-disabled="true"]))
) {
  transition:
    transform 210ms cubic-bezier(.2, .75, .25, 1),
    box-shadow 210ms ease,
    border-color 210ms ease,
    background-color 210ms ease,
    color 210ms ease;
  transform-origin: center;
}

.home-offer:has(a:not([aria-disabled="true"])) {
  transition: box-shadow 210ms ease, border-color 210ms ease;
}

.plan-switcher button.plan-tab {
  transition:
    background-color 210ms ease,
    border-color 210ms ease,
    box-shadow 210ms ease,
    color 210ms ease;
}

.text-link,
.nav-trigger {
  transform-origin: left center;
}

:where(
  .button,
  .text-link,
  .plan-tab,
  .nav-trigger,
  .menu-toggle,
  [data-linked-card]
):not(:disabled):not([aria-disabled="true"]):focus-visible,
:where(
  [data-linked-card]:not([aria-disabled="true"]),
  .home-offer:has(a:not([aria-disabled="true"])),
  .editorial-grid article:has(a:not([aria-disabled="true"])),
  .list-rows article:has(a:not([aria-disabled="true"])),
  .photo-credits figure:has(a:not([aria-disabled="true"]))
):has(a:focus-visible) {
  outline: 3px solid var(--color-focus, var(--color-accent));
  outline-offset: 4px;
}

@media (hover: hover) and (pointer: fine) {
  :where(
    .button,
    .text-link,
    .nav-trigger,
    .menu-toggle,
    [data-linked-card]
  ):not(:disabled):not([aria-disabled="true"]):hover {
    transform: scale(1.02);
  }

  :where(
    .editorial-grid article:has(a:not([aria-disabled="true"])),
    .list-rows article:has(a:not([aria-disabled="true"])),
    .photo-credits figure:has(a:not([aria-disabled="true"]))
  ):hover {
    transform: scale(1.018);
    box-shadow: 0 18px 44px rgb(0 0 0 / .16);
  }

  .home-offer:has(a:not([aria-disabled="true"])):hover {
    box-shadow:
      inset 0 0 0 1px var(--color-rule),
      0 18px 44px rgb(0 0 0 / .14);
  }

  .plan-switcher button.plan-tab:hover {
    transform: none;
    box-shadow: 0 6px 16px rgb(0 0 0 / .12);
  }

  .plan-switcher button.plan-tab:not([aria-selected="true"]):hover {
    background: var(--color-paper-3);
  }
}

:where(
  .button,
  .text-link,
  .nav-trigger,
  .menu-toggle,
  [data-linked-card]
):not(:disabled):not([aria-disabled="true"]):active,
:where(
  .editorial-grid article:has(a:not([aria-disabled="true"])),
  .list-rows article:has(a:not([aria-disabled="true"])),
  .photo-credits figure:has(a:not([aria-disabled="true"]))
):active {
  transform: scale(.98);
  transition-duration: 110ms;
}

.plan-switcher button.plan-tab:active {
  transform: none;
  box-shadow: inset 0 0 0 1px var(--color-rule);
  transition-duration: 110ms;
}

/* One-time section entrances: opacity and a short rise, without layout shifts.
   Longer than button feedback so editorial blocks arrive softly while scrolling. */
[data-scroll-reveal] {
  opacity: 0;
  translate: 0 14px;
  transition: opacity 520ms cubic-bezier(.22, 1, .36, 1) var(--reveal-delay, 0ms),
    translate 620ms cubic-bezier(.22, 1, .36, 1) var(--reveal-delay, 0ms),
    transform 210ms cubic-bezier(.2, .75, .25, 1),
    box-shadow 210ms ease, border-color 210ms ease;
}
[data-scroll-reveal="fade"] { translate: none; }
[data-scroll-reveal].is-revealed,
[data-scroll-reveal]:focus-within { opacity: 1; translate: none; }
[data-scroll-reveal]:focus-within { transition: none; }
@media (max-width: 640px) {
  [data-scroll-reveal="rise"]:not(.is-revealed):not(:focus-within) { translate: 0 8px; }
}

@media (prefers-reduced-motion: reduce) {
  :where(
    .button,
    .text-link,
    .plan-tab,
    .nav-trigger,
    .menu-toggle,
    [data-linked-card],
    .home-offer:has(a:not([aria-disabled="true"])),
    .editorial-grid article:has(a:not([aria-disabled="true"])),
    .list-rows article:has(a:not([aria-disabled="true"])),
    .photo-credits figure:has(a:not([aria-disabled="true"]))
  ) {
    transition: none !important;
    transform: none !important;
  }

  [data-scroll-reveal] {
    opacity: 1 !important;
    translate: none !important;
    transition: none !important;
  }
}

@media print {
  [data-scroll-reveal] { opacity: 1 !important; translate: none !important; transition: none !important; }
}
