/* ==========================================================================
   MOTION — keyframes, scroll reveals, the hero entrance, reduced motion.
   Reveal styles only apply when JS is running (html.js), so the page is
   fully readable without JavaScript.
   ========================================================================== */

/* ---- Keyframes ---------------------------------------------------------- */
@keyframes sway {
  from { transform: rotate(var(--rot, 0deg)) rotate(-2.4deg) skewX(-1.5deg); }
  to   { transform: rotate(var(--rot, 0deg)) rotate(2.2deg) skewX(1.5deg) translateY(6px); }
}
@keyframes kenburns {
  from { transform: scale(1.12) translate(0, 0); }
  to   { transform: scale(1.02) translate(-1.5%, 1%); }
}
@keyframes dapple {
  0%   { transform: translate(0, 0) rotate(0deg); opacity: 0.85; }
  50%  { transform: translate(4%, -3%) rotate(4deg); opacity: 1; }
  100% { transform: translate(-3%, 4%) rotate(-3deg); opacity: 0.75; }
}
@keyframes glint {
  0%, 70% { transform: translateX(-120%); }
  100%    { transform: translateX(120%); }
}
@keyframes marquee {
  to { transform: translateX(-50%); }
}
@keyframes swash {
  to { clip-path: inset(0 0 0 0); }
}
@keyframes scrollcue {
  0%   { transform: translateY(-100%); }
  100% { transform: translateY(240%); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes twinkle {
  from { opacity: 0.1; transform: scale(0.8); }
  to   { opacity: var(--o, 0.9); transform: scale(1.15); }
}
@keyframes sunset-breathe {
  from { transform: translateX(-50%) scale(0.94); opacity: 0.85; }
  to   { transform: translateX(-50%) scale(1.04) translateY(3%); opacity: 1; }
}
@keyframes slice-out {
  from { transform: translate(-4px, 4px) rotate(-90deg); opacity: 0; }
  60%  { opacity: 1; }
  to   { transform: translate(0, 0) rotate(0deg); opacity: 1; }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(26px); }
  to   { opacity: 1; transform: none; }
}
/* ends beyond the edges so the arch's drop shadow isn't clipped */
@keyframes arch-open {
  from { clip-path: inset(100% -30% -30% -30%); }
  to   { clip-path: inset(-30% -30% -30% -30%); }
}
@keyframes drop-in {
  from { opacity: 0; transform: translateY(-30px) rotate(-9deg); }
  to   { opacity: 1; transform: rotate(-3deg); }
}

/* ---- Hero entrance (runs once on load) ---------------------------------- */
.js .hero [data-enter] { opacity: 0; }
.js.is-loaded .hero [data-enter] {
  animation: rise 1.1s var(--ease-out) both;
  animation-delay: var(--d, 0ms);
}
.js.is-loaded .hero [data-enter="arch"] {
  opacity: 1;
  animation: arch-open 1.6s var(--ease-inout) both;
  animation-delay: var(--d, 0ms);
}
.js.is-loaded .hero [data-enter="card"] {
  animation: drop-in 1.1s cubic-bezier(0.3, 1.35, 0.5, 1) both;
  animation-delay: var(--d, 0ms);
}
.js .nav { opacity: 0; transform: translateY(-12px); }
.js.is-loaded .nav { opacity: 1; transform: none; transition: opacity 1s var(--ease-out) 0.1s, transform 1s var(--ease-out) 0.1s, background-color 0.5s; }
.js.is-loaded .hero__sun .mark__slice,
.js.is-loaded .nav .mark__slice { animation: slice-out 1.6s var(--ease-out) 0.35s both; }

/* ---- Scroll reveals ----------------------------------------------------- */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 1s var(--ease-out), transform 1.2s var(--ease-out);
  transition-delay: var(--delay, 0ms);
}
.js [data-reveal="fade"] { transform: none; }
.js [data-reveal="arch"] {
  opacity: 1;
  transform: none;
  clip-path: inset(100% -30% -30% -30%);
  transition: clip-path 1.6s var(--ease-inout);
  transition-delay: var(--delay, 0ms);
}
.js [data-reveal].is-in { opacity: 1; transform: none; }
.js [data-reveal="arch"].is-in { clip-path: inset(-30% -30% -30% -30%); }

/* headline split into words that rise from a mask */
.js [data-split] .w {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding: 0 0.08em 0.12em;
  margin: 0 -0.08em -0.12em;
}
.js [data-split] .w > span {
  display: inline-block;
  transform: translateY(110%);
  transition: transform 1.1s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 55ms + var(--delay, 0ms));
}
.js [data-split].is-in .w > span,
.js.is-loaded .hero [data-split] .w > span { transform: none; }

/* olive line art draws itself */
.js .olive-line path {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 1.8s var(--ease-inout);
  transition-delay: calc(var(--d, 0) * 1ms);
}
.js .is-in .olive-line path,
.js .olive-line.is-in path { stroke-dashoffset: 0; }

/* fraction pies grow in when revealed (JS animates the shape; this fades) */
.js .pie { opacity: 0; transition: opacity 0.8s var(--ease-out); }
.js .pie.is-in { opacity: 1; }

/* ---- Reduced motion: keep it calm and fully visible ----------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0ms !important;
  }
  .leafshadow, .dapple, .marquee__track, .seal__ring, .star, .finale__sun,
  .hero__arch img, .btn--primary::after, .hero__scroll-line::after { animation: none !important; }
  .marquee__track { flex-wrap: wrap; width: auto; }
  .marquee__group[aria-hidden="true"] { display: none; }
}
