/* Rara Avis: gentle motion and the phone/tablet menu.
   Scroll reveals only run when html has data-motion, which the head script
   sets unless the visitor asks for reduced motion. */

:root { --ease-out: cubic-bezier(.22, .7, .2, 1); }

/* ── Menu (below 1024px) ─────────────────────────────── */
@media (max-width: 63.99rem) {
  [data-nav-menu]:not([data-open]) { display: none; }
  [data-nav-menu] {
    min-height: calc(100dvh - 4.85rem);
    overflow-y: auto;
  }
  [data-nav-menu] li > a::before {
    counter-increment: navitem;
    content: counter(navitem, decimal-leading-zero);
    font: 600 .75rem/1 'Inter', sans-serif;
    letter-spacing: .14em;
    color: #FF5A1F;
    width: 2rem;
  }
  [data-nav-menu] .-nav-label {
    font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
    font-weight: 600;
    font-size: clamp(1.75rem, 7vw, 2.5rem);
    line-height: 1;
    letter-spacing: .01em;
    text-transform: uppercase;
  }
  [data-nav-menu] .-nav-arrow { transition: transform .3s var(--ease-out); }
  [data-nav-menu] a:hover .-nav-arrow { transform: translateX(4px); }
  [data-nav-menu] > .-nav-contact { margin-top: auto; }
  [data-nav-menu] > ul { counter-reset: navitem; }
}
@media (min-width: 48rem) and (max-width: 63.99rem) {
  [data-nav-menu] { min-height: calc(100dvh - 6.3rem); }
}

[data-nav-toggle] .-nav-bars span { transition: transform .3s var(--ease-out); }
[data-nav-toggle][aria-expanded="true"] .-nav-bars span:first-child { transform: translateY(3px) rotate(45deg); }
[data-nav-toggle][aria-expanded="true"] .-nav-bars span:last-child { transform: translateY(-3px) rotate(-45deg); }

@media (prefers-reduced-motion: no-preference) and (max-width: 63.99rem) {
  [data-nav-menu][data-open] { animation: rara-fade .35s var(--ease-out) both; }
  [data-nav-menu][data-open] li,
  [data-nav-menu][data-open] > .-nav-contact { animation: rara-rise .5s var(--ease-out) both; }
  [data-nav-menu][data-open] li:nth-child(1) { animation-delay: .06s; }
  [data-nav-menu][data-open] li:nth-child(2) { animation-delay: .11s; }
  [data-nav-menu][data-open] li:nth-child(3) { animation-delay: .16s; }
  [data-nav-menu][data-open] li:nth-child(4) { animation-delay: .21s; }
  [data-nav-menu][data-open] li:nth-child(5) { animation-delay: .26s; }
  [data-nav-menu][data-open] li:nth-child(n+6) { animation-delay: .31s; }
  [data-nav-menu][data-open] > .-nav-contact { animation-delay: .36s; }
  [data-nav-menu][data-closing] { animation: rara-fade-out .2s ease-in both; }
  [data-nav-menu][data-closing] li, [data-nav-menu][data-closing] > .-nav-contact { animation: none; }
}

/* ── Scroll reveals ───────────────────────────────────── */
html[data-motion] main section > div > div > *,
html[data-motion] main ul[data-reveal-list] > li {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .8s var(--ease-out), transform .9s var(--ease-out);
  transition-delay: var(--reveal-delay, 0s);
}
html[data-motion] main .is-in {
  opacity: 1 !important;
  transform: none !important;
}

/* Decorative eyebrow rules draw in from the left. */
html[data-motion] main p > span:empty {
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 1s var(--ease-out) .25s;
}
html[data-motion] main .is-in p > span:empty,
html[data-motion] main p.is-in > span:empty { transform: none; }

/* The hero photo settles in. */
@media (prefers-reduced-motion: no-preference) {
  main > section:first-child > img { animation: rara-settle 2.4s var(--ease-out) both; }
}

/* ── Small comforts ───────────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  main a > span[aria-hidden="true"] { display: inline-block; transition: transform .3s var(--ease-out); }
  main a:hover > span[aria-hidden="true"] { transform: translateX(4px); }

  summary > span[aria-hidden="true"] { transition: transform .35s var(--ease-out); }
  details[open] > summary > span[aria-hidden="true"] { transform: rotate(45deg); }

  html { interpolate-size: allow-keywords; }
  details::details-content {
    block-size: 0;
    overflow: clip;
    transition: block-size .4s var(--ease-out), content-visibility .4s allow-discrete;
  }
  details[open]::details-content { block-size: auto; }
}

@keyframes rara-fade { from { opacity: 0; } }
@keyframes rara-fade-out { to { opacity: 0; } }
@keyframes rara-rise { from { opacity: 0; transform: translateY(12px); } }
@keyframes rara-settle { from { transform: scale(1.06); opacity: .6; } }
