/* Renfa CSS ports from Motion Prompt, pinned at
 * showheyohtaki/motion-prompt@da14d9c4a0772598b03b38c191f76bc2e9e81dab.
 * Only the page content and palette are adapted; trigger events replace the
 * Canvas demo cursor/scroll, and eOut(x)=1-(1-x)^3 maps to the cubic below.
 *
 * MIT License — Copyright (c) 2026 Shohei Ohtaki
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */

/* Motion Prompt #073-096 · MIT License (c) 2026 Shohei Ohtaki · https://showheyohtaki.github.io/motion-prompt/#073 */
:root {
  --renfa-motion-cubic-out: cubic-bezier(.333333, 1, .666667, 1);
  --renfa-motion-accent: var(--presentation-accent, #82aaff);
  --renfa-motion-track: var(--presentation-line, #30333b);
}

/* Motion Prompt #081 · MIT License (c) 2026 Shohei Ohtaki · https://showheyohtaki.github.io/motion-prompt/#081 */
body .home-editorial [data-featured-case-card] > a {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .08);
  transition: transform 300ms var(--renfa-motion-cubic-out), box-shadow 300ms var(--renfa-motion-cubic-out);
}
/* The untransformed parent keeps the original hit area, including its lower
 * edge. Moving the hit area itself would alternate mouse enter/leave there. */
@media (hover: hover) and (pointer: fine) {
  body .home-editorial [data-featured-case-card]:hover > a {
    transform: translateY(-10px);
    box-shadow: 0 12px 22px rgba(0, 0, 0, .22);
  }
}
body .home-editorial [data-featured-case-card] > a:focus-visible {
  transform: translateY(-10px);
  box-shadow: 0 12px 22px rgba(0, 0, 0, .22);
}

/* Motion Prompt #086 · MIT License (c) 2026 Shohei Ohtaki · https://showheyohtaki.github.io/motion-prompt/#086 */
/* Background sizing leaves the existing brand and navigation pseudo-elements
 * alone. Text metrics and link geometry remain unchanged. */
body .site-header :is(.desktop-nav, .header-case-links) a[href],
body .site-header[data-renfa-public-navigation] :is(.desktop-nav, .header-case-links) a[href] {
  background-image: linear-gradient(var(--renfa-motion-accent), var(--renfa-motion-accent));
  background-repeat: no-repeat;
  background-size: 0 3px;
  background-position: 100% calc(50% + 14.5px);
  background-origin: content-box;
  transition: background-size 300ms var(--renfa-motion-cubic-out), color 200ms ease;
}
@media (hover: hover) and (pointer: fine) {
  body .site-header :is(.desktop-nav, .header-case-links) a[href]:hover {
    background-size: 100% 3px;
    background-position-x: 0;
  }
}
body .site-header :is(.desktop-nav, .header-case-links) a[href]:focus-visible {
  background-size: 100% 3px;
  background-position-x: 0;
}

/* Existing case links use a hover background shorthand. Restore each paint
 * property with matching specificity, without altering font or link size. */
body .site-header .header-case-links a[href]:is(:hover, :focus-visible) {
  background-image: linear-gradient(var(--renfa-motion-accent), var(--renfa-motion-accent));
  background-repeat: no-repeat;
  background-origin: content-box;
  background-position-y: calc(50% + 14.5px);
  text-decoration: none;
}

/* Motion Prompt #079 · MIT License (c) 2026 Shohei Ohtaki · https://showheyohtaki.github.io/motion-prompt/#079 */
.renfa-motion-progress {
  position: fixed;
  z-index: 1001;
  inset: 0 0 auto;
  height: 6px;
  overflow: hidden;
  background: var(--renfa-motion-track);
  pointer-events: none;
  contain: layout paint;
}
.renfa-motion-progress > span {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--renfa-motion-accent);
  transform: scaleX(0);
  transform-origin: 0 50%;
  pointer-events: none;
}
.renfa-motion-progress[hidden] { display: none !important; }
/* The mobile menu belongs to the header's stacking context. Its open state
 * hides this decorative bar so the menu remains the topmost public surface. */
body:has(.site-header .menu-button[aria-expanded="true"]) .renfa-motion-progress,
body:has(.site-header .mobile-nav.is-open) .renfa-motion-progress { visibility: hidden; }

@media (prefers-reduced-motion: reduce) {
  body .home-editorial [data-featured-case-card] > a,
  body .home-editorial [data-featured-case-card]:hover > a,
  body .home-editorial [data-featured-case-card] > a:focus-visible {
    transform: none;
    transition: none !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .08);
  }
  body .site-header :is(.desktop-nav, .header-case-links) a[href],
body .site-header[data-renfa-public-navigation] :is(.desktop-nav, .header-case-links) a[href] { transition: none !important; }
}
