/* ==========================================================================
   SERES — Responsive overrides
   ========================================================================== */

.page-loader.is-exiting {
  transform: translateY(-100%);
  transition: transform 1.15s cubic-bezier(0.65, 0, 0.35, 1);
}

@media (prefers-reduced-motion: reduce) {
  .page-loader.is-exiting {
    transition: none;
    transform: none;
  }
}

@media (max-width: 900px) {
  .site-header {
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto;
    gap: 0;
    padding-block: 1rem;
    padding-inline: clamp(1.25rem, 4vw, 1.75rem);
  }

  .site-header__menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    justify-self: start;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    border: none;
    background: none;
    color: var(--color-text-muted);
    cursor: pointer;
    border-radius: 50%;
    transition: color var(--transition), background var(--transition);
  }

  .site-header__menu-btn:hover,
  .site-header__menu-btn:focus-visible {
    color: var(--color-accent);
    background: rgba(0, 0, 0, 0.05);
  }

  .site-header__menu-icon {
    position: relative;
    display: block;
    width: 1.35rem;
    height: 2px;
    background: currentColor;
    transition: background var(--transition);
  }

  .site-header__menu-icon::before,
  .site-header__menu-icon::after {
    content: "";
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background: currentColor;
    transition: transform var(--transition), top var(--transition);
  }

  .site-header__menu-icon::before {
    top: -7px;
  }

  .site-header__menu-icon::after {
    top: 7px;
  }

  .site-header.is-menu-open .site-header__menu-icon {
    background: transparent;
  }

  .site-header.is-menu-open .site-header__menu-icon::before {
    top: 0;
    transform: rotate(45deg);
  }

  .site-header.is-menu-open .site-header__menu-icon::after {
    top: 0;
    transform: rotate(-45deg);
  }

  .site-header__logo {
    grid-column: 2;
    grid-row: 1;
    justify-self: center;
  }

  .site-header__logo-img {
    height: 1.5rem;
  }

  .site-header__nav--right {
    display: none;
  }

  .site-header__spacer {
    display: block;
    width: 2.75rem;
    height: 2.75rem;
    justify-self: end;
  }

  .site-header__drawer {
    display: block;
    position: fixed;
    top: 0;
    right: 0;
    z-index: 110;
    width: min(18rem, 88vw);
    height: 100vh;
    height: 100dvh;
    padding: calc(var(--header-height) + 1.5rem) 1.75rem 2rem;
    background: var(--color-surface);
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.12);
    transform: translateX(100%);
    transition: transform 0.35s ease;
    overflow-y: auto;
  }

  .site-header.is-menu-open .site-header__drawer {
    transform: translateX(0);
  }

  .site-header__drawer-nav {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
  }

  .site-header__drawer-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    padding: 0.9rem 0;
    font-family: var(--font-body);
    font-size: 1.0625rem;
    font-weight: 500;
    color: var(--color-text-muted);
    text-decoration: none;
    text-align: left;
    background: none;
    border: none;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: color var(--transition);
  }

  .site-header__drawer-link[href] {
    position: relative;
  }

  .site-header__drawer-link[href]::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0.65rem;
    height: 2px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.28s ease;
  }

  .site-header__drawer-link[href]:hover::after,
  .site-header__drawer-link[href]:focus-visible::after {
    transform: scaleX(1);
  }

  .site-header__drawer-link:hover,
  .site-header__drawer-link:focus-visible {
    color: var(--color-accent);
  }

  .site-header__drawer-link--btn {
    font-family: inherit;
  }

  .site-header__drawer-cta {
    margin-top: 1.25rem;
    width: 100%;
    justify-content: center;
    padding: 0.85rem 1.25rem;
    font-size: 0.9375rem;
    border-bottom: none;
  }

  .site-header__backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 105;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
  }

  .site-header__backdrop:not([hidden]) {
    opacity: 1;
    pointer-events: auto;
  }

  body.is-nav-open {
    overflow: hidden;
  }
}

@media (max-width: 768px) {
  .drive-stats__grid {
    grid-template-columns: 1fr;
    gap: 2.25rem;
  }

  .colors-showcase__specs {
    grid-template-columns: repeat(2, 1fr);
    row-gap: 1.75rem;
    max-width: none;
  }

  .colors-showcase__spec {
    padding-inline: 0;
  }

  .colors-showcase__spec:not(:nth-child(2n)) {
    padding-right: 1rem;
    border-right: 1px solid #d8d8d8;
  }

  .colors-showcase__spec:nth-child(2n) {
    padding-left: 1rem;
  }
}

@media (max-width: 520px) {
  .colors-showcase__specs {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 0;
    padding-bottom: 0.5rem;
    scrollbar-width: thin;
  }

  .colors-showcase__spec {
    flex: 0 0 42%;
    scroll-snap-align: start;
    border-right: 1px solid #d8d8d8;
    padding-inline: 1.25rem;
  }

  .colors-showcase__spec:first-child {
    padding-left: 0;
  }

  .colors-showcase__spec:nth-child(odd),
  .colors-showcase__spec:nth-child(even) {
    padding-inline: 1.25rem;
  }
}

@media (max-width: 900px) {
  .exterior-design__inner {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    row-gap: 2rem;
  }

  .exterior-design__intro,
  .exterior-design__figure,
  .exterior-design__features {
    grid-column: 1;
    grid-row: auto;
    max-width: none;
  }

  .exterior-design__intro {
    margin-bottom: 0.25rem;
  }
}

@media (max-width: 768px) {
  .scroll-reveal__title {
    top: clamp(5.25rem, 10vh, 5.75rem);
    left: clamp(1.25rem, 5vw, 2rem);
    font-size: clamp(2rem, 9vw, 2.75rem);
    max-width: 11ch;
  }

  .scroll-reveal--interior .scroll-reveal__title {
    max-width: 14ch;
  }

  .scroll-reveal__media-frame {
    top: 42%;
    left: 7%;
    right: 7%;
    height: 42%;
  }

  /* Keep pinned scroll sections above the color picker during fast scroll */
  .scroll-reveal.is-pin-active {
    z-index: 20;
  }
}

@media (max-width: 900px) {
  .safety-features__inner {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .safety-features__figure {
    order: -1;
  }
}

@media (max-width: 900px) {
  .tech-gallery {
    --tech-gallery-pad: clamp(1.5rem, 6vw, 2.5rem);
    --tech-gallery-img: clamp(10rem, 32vw, 12rem);
    --tech-gallery-panel: min(
      17rem,
      calc(100vw - (2 * var(--tech-gallery-pad)) - var(--tech-gallery-gap))
    );
  }

  .tech-gallery__pin {
    height: clamp(20rem, 42vh, 24rem);
  }
}

@media (max-width: 768px) {
  .feature-tabs {
    padding-block: clamp(3rem, 7vw, 4.5rem);
    padding-inline: clamp(1.5rem, 6vw, 2.5rem);
  }

  .feature-tabs__inner {
    max-width: none;
  }

  .feature-tabs__controls {
    padding-top: 1.25rem;
  }

  .feature-tabs__nav {
    justify-content: flex-start;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 1.5rem;
  }

  .feature-tabs__nav::-webkit-scrollbar {
    display: none;
  }

  .feature-tabs__tab {
    flex: 0 0 auto;
    max-width: 11rem;
    scroll-snap-align: center;
    white-space: normal;
  }

  .feature-tabs__copy {
    padding-top: 1.5rem;
    text-align: center;
  }
}

@media (max-width: 640px) {
  .hero__content {
    padding-left: 1.25rem;
    padding-bottom: 2.5rem;
  }

  .hero__features {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }

  .hero__features li:not(:last-child)::after {
    display: none;
  }

  .hero__cta {
    width: 100%;
    max-width: 18rem;
  }

  .site-footer__grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .contact-layout {
    grid-template-columns: 1fr;
  }

  .contact-form {
    padding: 1.5rem;
  }

  .page-content .page-block .btn {
    display: inline-block;
    width: 100%;
    max-width: 18rem;
    text-align: center;
  }

  .page-content .page-block .btn + .btn {
    margin-left: 0;
    margin-top: 0.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
