/* Motion for the public site: hero entrance on load and reveal-on-scroll for content blocks.
   Everything is inside prefers-reduced-motion: no-preference; content is fully visible without it.
   Reveal uses CSS scroll-driven animations where supported; motion.js adds an
   IntersectionObserver fallback (html.io) elsewhere. Stagger comes from --i set by motion.js. */

@keyframes rise{from{opacity:0;translate:0 28px}to{opacity:1;translate:0 0}}
@keyframes rise-sm{from{opacity:0;translate:0 14px}to{opacity:1;translate:0 0}}
@keyframes slide-in{from{opacity:0;translate:48px 0}to{opacity:1;translate:0 0}}
@keyframes pop{0%{opacity:0;scale:.4}70%{opacity:1;scale:1.08}100%{opacity:1;scale:1}}
@keyframes grow-x{from{scale:0 1}to{scale:1 1}}
@keyframes word{from{opacity:0;translate:0 .45em;filter:blur(6px)}to{opacity:1;translate:0 0;filter:blur(0)}}

@media (prefers-reduced-motion:no-preference){
  /* Landing hero: staggered entrance. */
  .hero .eyebrow{animation:rise-sm .7s cubic-bezier(.2,.7,.2,1) .05s both}
  .hero h1{animation:rise .9s cubic-bezier(.2,.7,.2,1) .15s both}
  .hero h1.is-split{animation:none}
  .hero h1.is-split .w{display:inline-block;animation:word .8s cubic-bezier(.2,.7,.2,1) both;animation-delay:calc(.15s + var(--i) * 55ms)}
  .hero .lead{animation:rise .8s cubic-bezier(.2,.7,.2,1) .55s both}
  .hero .hero-actions{animation:rise .8s cubic-bezier(.2,.7,.2,1) .7s both}
  .hero .planned-note{animation:rise-sm .8s cubic-bezier(.2,.7,.2,1) .85s both}
  .hero .call-card{animation:slide-in 1s cubic-bezier(.2,.7,.2,1) .4s both}
  .hero .wifi-mark{animation:pop .7s cubic-bezier(.2,.7,.2,1) 1.1s both}

  /* Inner page headers. */
  .page-hero .breadcrumbs{animation:rise-sm .6s cubic-bezier(.2,.7,.2,1) both}
  .page-hero h1,.article h1{animation:rise .8s cubic-bezier(.2,.7,.2,1) .08s both}
  .page-hero .lead,.page-hero .badge,.page-hero .callout,.article .meta{animation:rise .8s cubic-bezier(.2,.7,.2,1) .22s both}
  .page-hero .hero-actions{animation:rise .8s cubic-bezier(.2,.7,.2,1) .34s both}
  .page-hero .hero-meta{animation:slide-in .9s cubic-bezier(.2,.7,.2,1) .3s both}

  /* Reveal on scroll: scroll-driven where supported. */
  @supports (animation-timeline:view()){
    .reveal{
      animation:rise linear both;
      animation-timeline:view();
      animation-range:entry calc(4% + var(--i, 0) * 5%) cover calc(24% + var(--i, 0) * 5%);
    }
    .step.reveal:before{animation:grow-x linear both;animation-timeline:view();animation-range:entry 30% cover 40%;transform-origin:left}
  }

  /* Fallback: IntersectionObserver toggles .in. */
  html.io .reveal{opacity:0;translate:0 28px;transition:opacity .7s cubic-bezier(.2,.7,.2,1),translate .7s cubic-bezier(.2,.7,.2,1);transition-delay:calc(var(--i, 0) * 90ms)}
  html.io .reveal.in{opacity:1;translate:0 0}
  html.io .step.reveal:before{scale:0 1;transform-origin:left;transition:scale .8s cubic-bezier(.2,.7,.2,1) .3s}
  html.io .step.reveal.in:before{scale:1 1}
}
@media (max-width:620px){
  .step.reveal:before{transform-origin:top}
}

/* ---------------------------------------------------------------------------------------------
   Hover and focus states. Movement only where it signals direction (arrows) or that a whole card
   is a link; plain content cards do not react. Pointer devices only; reduced motion keeps the
   colour changes and drops the movement. */
:root{--ease-out:cubic-bezier(.2,.7,.2,1)}

.button,.btn,.quick-grid a,.global-nav a,.local-nav a,.footer-nav a,.footer-social a,.news-card,.news-card h3,
.hub-grid a,.page-index a,.link-card,.accordions summary,.toc a,.download-row a,.resource-actions a,.location-list a,
.card-link,.text-blue,.lang-switch button,.account-link,.st-grid label,.choice,.radio-cards label,.show-on-map{
  transition:color .18s ease,background-color .18s ease,border-color .18s ease,box-shadow .2s ease,translate .2s var(--ease-out),transform .2s var(--ease-out)}
.button span,.btn span,.card-link span,.hub-grid a:after,.news-feature .text-blue{display:inline-block;transition:translate .2s var(--ease-out)}

@media (hover:hover){
  /* Buttons: colour shift, arrow nudges in its direction. */
  .button.ghost:hover{background:rgba(255,255,255,.12);border-color:#fff}
  .button.white:hover,.light-button:hover{background:var(--lime);color:var(--deep)}
  .btn.outline:hover{background:#f2f5ff}
  .button:hover span,.btn:hover span,.card-link:hover span{translate:4px 0}
  .button[aria-disabled="true"]:hover{background:transparent;border-color:rgba(255,255,255,.65)}
  .button[aria-disabled="true"]:hover span{translate:0 0}

  /* Navigation: underline slides in under the link. */
  .global-nav a,.footer-nav a{background:linear-gradient(currentColor,currentColor) 0 100%/0 1px no-repeat;transition:background-size .25s var(--ease-out),color .18s ease}
  .global-nav a:hover,.footer-nav a:hover{background-size:100% 1px}
  .local-nav a:not([aria-current]):hover{border-bottom-color:rgba(200,255,55,.5)}
  .lang-switch button:not([aria-pressed="true"]):hover{background:rgba(255,255,255,.14);color:#fff}
  .account-link:hover{color:var(--lime)}
  .quick-grid a:hover{background:#f4f7ff;color:var(--blue)}
  .toc a:hover{background:#f7f9fe}

  /* Whole-card links: lift slightly with a tight shadow. */
  .news-card:hover,.page-index a:hover,.link-card:hover{transform:translateY(-3px);box-shadow:0 8px 20px rgba(16,17,168,.08);border-color:#b9c6ea}
  .news-feature:hover .text-blue{translate:4px 0}
  .news-feature:hover h2{color:var(--blue)}
  .hub-grid a:hover{color:var(--blue)}
  .hub-grid a:hover:after{translate:4px 0}

  /* Lists and rows. */
  .accordions summary:hover{color:var(--blue)}
  .location-list a:hover{box-shadow:inset 3px 0 0 var(--blue)}
  .download-row:hover,.resource-item:hover{border-color:#b9c6ea}
  .download-row a:hover,.resource-actions a:hover,.text-blue:hover{color:var(--deep);text-decoration:underline;text-underline-offset:3px}
  .footer-social a:hover{translate:0 -2px}

  /* Form choices. */
  .st-grid label:hover,.choice:hover,.radio-cards label:hover{border-color:var(--royal)}
}

/* Keyboard focus gets the same affordances as hover. */
.button:focus-visible span,.btn:focus-visible span,.card-link:focus-visible span{translate:4px 0}
.news-card:focus-visible,.page-index a:focus-visible{border-color:var(--blue)}

@media (prefers-reduced-motion:reduce){
  .news-card:hover,.page-index a:hover,.link-card:hover{transform:none}
  .footer-social a:hover{translate:none}
  .button:hover span,.btn:hover span,.card-link:hover span,.hub-grid a:hover:after,.news-feature:hover .text-blue{translate:none}
}

/* ---------------------------------------------------------------------------------------------
   Functional motion: state changes the visitor caused or needs to notice. */
@keyframes fill-bar{from{width:0}}
@keyframes fade-rise{from{opacity:0;translate:0 10px}to{opacity:1;translate:0 0}}
@keyframes fade-in{from{opacity:0}to{opacity:1}}
@keyframes chip-in{0%{opacity:0;scale:.85}100%{opacity:1;scale:1}}
@keyframes vt-out{to{opacity:0}}
@keyframes vt-in{from{opacity:0}}

@media (prefers-reduced-motion:no-preference){
  /* Call card: the elapsed part of the application period fills in once the card has arrived. */
  .call-card .progress span{animation:fill-bar 1.2s var(--ease-out) 1.2s both}

  /* FAQ accordions open and close smoothly (Chromium 131+; elsewhere they open instantly). */
  @supports (interpolate-size:allow-keywords){
    :root{interpolate-size:allow-keywords}
    .accordions details::details-content{height:0;overflow:clip;transition:height .3s var(--ease-out),content-visibility .3s allow-discrete}
    .accordions details[open]::details-content{height:auto}
  }
  .accordions summary span{transition:transform .25s var(--ease-out)}

  /* Content that appears after an action: form steps, registration panels, tabs, filtered results. */
  .form-step.active,[data-reg-panel]:not([hidden]),#sentStep:not([hidden]),#doneState:not([hidden]),
  [role="tabpanel"]:not([hidden]),.location-list li,
  .site-card[open] .site-section,.inventory-row,.inv-more[open] .field-grid,.evidence-meta[open] dl{
    animation:fade-rise .35s var(--ease-out) both}
  form [role="status"]:not([hidden]),.scan-state,.site-state,.review-list .review-ok{animation:chip-in .25s var(--ease-out) both}

  /* Mobile menu slides in when opened. */
  .nav-open .global-nav,.nav-open .local-nav{animation:fade-rise .25s var(--ease-out) both}

  /* Save confirmation and dialogs. */
  .confirm-dialog[open]{animation:fade-rise .25s var(--ease-out) both}
  .confirm-dialog[open]::backdrop{animation:fade-in .25s ease both}

  /* Page-to-page: a short cross-fade; header and navigation stay in place. */
  @view-transition{navigation:auto}
  .site-header{view-transition-name:site-header}
  .local-bar{view-transition-name:local-bar}
  ::view-transition-old(root){animation:vt-out .18s ease both}
  ::view-transition-new(root){animation:vt-in .28s ease both}
}
.page-hero{overflow-x:clip}
