/* =========================================================
   CSS-first interaction layer
   Replaces layout/scroll/FAQ/flip/menu JavaScript where CSS/HTML can do it.
   ========================================================= */

/* Mobile menu state is native checkbox + CSS. */
.nav-toggle{position:absolute;inline-size:1px;block-size:1px;opacity:0;pointer-events:none;clip-path:inset(50%)}
@media(max-width:940px){
  .nav-toggle:checked ~ .nav{transform:none!important}
  .nav-toggle:checked ~ .burger span:nth-child(1){transform:translateY(8px) rotate(45deg)}
  .nav-toggle:checked ~ .burger span:nth-child(2){opacity:0}
  .nav-toggle:checked ~ .burger span:nth-child(3){transform:translateY(-8px) rotate(-45deg)}
  body:has(.nav-toggle:checked){overflow:hidden}
}

/* CSS scroll progress + header state. Fallback keeps the page fully usable. */
#progress{width:100%!important;transform:scaleX(0);transform-origin:left center}
.foot-top-btn{opacity:1;transform:none;pointer-events:auto;text-decoration:none}
@supports (animation-timeline:scroll()){
  #progress{animation:page-progress linear both;animation-timeline:scroll(root block)}
  #header{animation:header-scroll-state linear both;animation-timeline:scroll(root block);animation-range:0 28px}
  .foot-top-btn{opacity:0;pointer-events:none;animation:top-button-state linear both;animation-timeline:scroll(root block);animation-range:520px 700px}
}
@supports not (animation-timeline:scroll()){
  #progress{display:none}
  #header{background:rgba(5,8,16,.9);border-color:rgba(148,163,184,.1);box-shadow:0 10px 50px rgba(0,0,0,.4);backdrop-filter:blur(20px)}
}
@keyframes page-progress{to{transform:scaleX(1)}}
@keyframes header-scroll-state{
  from{background:rgba(5,8,16,0);border-color:transparent;box-shadow:none;backdrop-filter:blur(0)}
  to{background:rgba(5,8,16,.9);border-color:rgba(148,163,184,.1);box-shadow:0 10px 50px rgba(0,0,0,.4);backdrop-filter:blur(20px)}
}
@keyframes top-button-state{0%,1%{opacity:0;pointer-events:none}100%{opacity:1;pointer-events:auto}}

/* Scroll reveals are CSS view-timeline animations. Browsers without the
   feature simply show the content instead of hiding it. */
.reveal,.reveal.is-visible{opacity:1!important;transform:none!important}
@supports (animation-timeline:view()){
  .reveal{animation:reveal-on-view .8s var(--ease) both;animation-timeline:view();animation-range:entry 0% cover 24%}
  .reveal.reveal-delay-1{animation-range:entry 6% cover 28%}
  .reveal.reveal-delay-2{animation-range:entry 12% cover 32%}
  .reveal.reveal-delay-3{animation-range:entry 18% cover 36%}
}
@keyframes reveal-on-view{from{opacity:0;transform:translateY(34px)}to{opacity:1;transform:none}}

/* Flip cards: hover for pointer devices, focus/focus-within for keyboard/touch. */
.flip:focus{outline:none}
.flip:focus-visible{outline:2px solid var(--cyan);outline-offset:4px;border-radius:22px}
.flip:focus .flip-front,.flip:focus-within .flip-front{transform:rotateY(180deg);opacity:0;pointer-events:none}
.flip:focus .flip-back,.flip:focus-within .flip-back{transform:rotateY(0deg);opacity:1}

/* FAQ is native <details>/<summary>; no accordion JavaScript required. */
details.faq-item>summary.faq-question{list-style:none}
details.faq-item>summary.faq-question::-webkit-details-marker{display:none}
details.faq-item[open] .faq-icon{transform:rotate(45deg)}
details.faq-item .faq-answer{max-height:none!important;overflow:visible}
details.faq-item:not([open]) .faq-answer{display:none}

/* Native radio state replaces JavaScript .sel toggling in the quote builder. */
.choice-input{position:absolute;inline-size:1px;block-size:1px;opacity:0;pointer-events:none;clip-path:inset(50%)}
.choice-input:focus-visible + .vehicle-category-option,.choice-input:focus-visible + .quote-service-option{outline:2px solid var(--cyan);outline-offset:3px}
.choice-input:checked + .vehicle-category-option,.choice-input:checked + .quote-service-option{border-color:var(--cyan)!important;background:rgba(0,229,255,.1)!important;color:var(--cyan)!important;box-shadow:0 0 24px rgba(0,229,255,.12)}

/* Equal-height media/content pairs are grid/flex layout, not measurements. */
@media(min-width:1141px){
  .hero-grid{align-items:stretch!important}
  .hero-grid>div:first-child{min-width:0}
  .hero-visual{align-self:stretch!important;height:auto!important;min-height:0!important}
  .hero-frame{height:100%!important;min-height:0!important;aspect-ratio:auto!important}
  .hero-frame>img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}

  .hero-layout{align-items:stretch!important}
  .hero-left{align-self:start;min-width:0}
  .hero-right{align-self:stretch!important;display:flex;width:556px;min-width:0}
  .hero-photo{flex:1;width:100%!important;height:auto!important;min-height:0!important;aspect-ratio:auto!important}
  .hero-photo>img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}

  .story-grid,.intro-grid{align-items:stretch!important}
  .story-img-wrap,.intro-image{align-self:stretch!important;height:auto!important;min-height:0!important;aspect-ratio:auto!important}
  .story-img{height:100%!important;min-height:0!important}
  .story-img>img,.intro-image>img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
}
@media(min-width:941px){
  .process-grid,.location-grid{align-items:stretch!important}
  .process-left{height:auto!important;align-self:stretch!important}
  .process-img{flex:1;min-height:0!important;aspect-ratio:auto!important}
  .map-card{height:auto!important;min-height:0!important;align-self:stretch!important}
}

/* Home hero rotation and promotional-band parallax are CSS animations. */
.hero-bg img{opacity:0;animation:hero-image-cycle 18s var(--ease) infinite}
.hero-bg img:nth-child(1){animation-delay:0s}
.hero-bg img:nth-child(2){animation-delay:6s}
.hero-bg img:nth-child(3){animation-delay:12s}
@keyframes hero-image-cycle{0%,30%{opacity:1}33.333%,96.666%{opacity:0}100%{opacity:1}}
@supports (animation-timeline:view()){
  #serviceBannerBackground{animation:band-parallax linear both;animation-timeline:view();animation-range:entry 0% exit 100%}
}
@keyframes band-parallax{from{transform:translateY(34px)}to{transform:translateY(-34px)}}

@media(prefers-reduced-motion:reduce){
  .reveal{animation:none!important;opacity:1!important;transform:none!important}
  .hero-bg img{animation:none!important;opacity:0!important}
  .hero-bg img:first-child{opacity:1!important}
  #serviceBannerBackground{animation:none!important;transform:none!important}
  #progress,#header,.foot-top-btn{animation:none!important}
  #progress{display:none}
  .foot-top-btn{opacity:1;pointer-events:auto}
}
