/* Motion for the static pages. Rules only; timing comes from the tokens in entry.*.css.
   Content is visible without JavaScript. site.js adds the "js" class, and only then do
   .reveal elements start hidden and fade in as they scroll into view. */

/* Without JavaScript, show everything at once. */
html:not(.js) .reveal {
  opacity: 1;
  transform: none;
  transition: none;
}

/* Stagger siblings that reveal together. */
.js .reveal-delay-1 { transition-delay: 0.1s; }
.js .reveal-delay-2 { transition-delay: 0.22s; }
.js .reveal-delay-3 { transition-delay: 0.38s; }
.js .reveal-delay-4 { transition-delay: 0.54s; }

/* Page-to-page transitions: the page cross-fades in place. Browsers without
   support load the next page normally. */
@view-transition {
  navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.5s;
  animation-timing-function: var(--ease-out-expo);
}

/* Hero: the hand outline draws itself, one stroke after another. */
.impression-hand .draw-stroke {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: draw-stroke 1.4s var(--ease-out-expo) forwards;
  animation-delay: calc(var(--i, 0) * 0.18s + 0.35s);
}

@keyframes draw-stroke {
  to { stroke-dashoffset: 0; }
}

/* Services list: each card slides up as it enters the viewport. Uses `translate`, so
   the hover lift in entry.css still works. Browsers without scroll-driven animations
   show the cards in place. */
@supports (animation-timeline: view()) {
  .service-card {
    animation: card-in linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 35%;
  }

  @keyframes card-in {
    from { opacity: 0; translate: 0 24px; }
    to { opacity: 1; translate: 0 0; }
  }
}

/* Navigation: an underline draws in under each link on hover and focus. */
.app-nav .nav-link {
  background: linear-gradient(currentColor, currentColor) no-repeat 0 100% / 0 1px;
  padding-bottom: 4px;
  transition: color var(--duration-fast) ease, background-size 0.45s var(--ease-out-expo);
}

.app-nav .nav-link:hover,
.app-nav .nav-link:focus-visible {
  background-size: 100% 1px;
}

/* Buttons: press feedback. Magnetic hover is added in site.js for pointer devices. */
.btn-primary:active {
  transform: scale(0.98);
}

/* Reduced motion: no movement, no fade and no drawing, for everyone who asks for it. */
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .impression-hand .draw-stroke {
    animation: none;
    stroke-dashoffset: 0;
  }

  .service-card {
    animation: none;
  }

  .app-nav .nav-link {
    transition: color var(--duration-fast) ease;
  }

  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none;
  }
}

/* Home page: the gift card band between services and the story. */
.section-gift { padding-block: var(--space-lg); background: var(--color-surface); border-block: 1px solid var(--color-border); }
.gift-band { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-sm) var(--space-md); }
.gift-band-text { max-width: 620px; }
.gift-band-text h2 { font-size: var(--text-2xl); margin: .5rem 0; }
.gift-band-text .section-sub { color: var(--color-text-muted); line-height: 1.7; margin: 0; }
.gift-band-actions { display: flex; flex-wrap: wrap; gap: .75rem; }

/* Gift cards link in the menu: an icon and the accent colour, so it stands out from the other links. */
.nav-gift { display: inline-flex; align-items: center; gap: .45rem; color: var(--color-accent) !important; }
.nav-link.nav-gift { border: 1px solid var(--color-accent); padding: .35rem .7rem; }
.nav-gift:hover { background: color-mix(in oklch, var(--color-accent) 12%, transparent); }
.gift-icon { width: 1.05em; height: 1.05em; flex-shrink: 0; }
@media (prefers-reduced-motion: no-preference) {
  .nav-gift .gift-icon { transition: transform var(--duration-normal) var(--ease-out-expo); }
  .nav-gift:hover .gift-icon { transform: rotate(-8deg) scale(1.1); }
}
/* Four menu links fit on one line each, in French too. */
.nav-links { gap: 1.5rem; }
.nav-link { white-space: nowrap; }
@media (width <= 1100px) { .nav-links { gap: .9rem; } .nav-actions { gap: .75rem; } .nav-link.nav-gift { padding: .3rem .5rem; } }
/* Tablet widths: with four links the full menu no longer fits, so the mobile menu starts at 900px. */
@media (width <= 900px) {
  header.app-nav .nav-links, header.app-nav .nav-actions { display: none; }
  header.app-nav .nav-toggle { display: flex; }
}
