/* Keep the existing desktop presentation; adapt smaller screens only. */
.hero-head { width: 100%; text-align: left; }
.hero h1 { text-align: left; margin-inline: 0; }
.hero-title-phrase { display: inline-block; }
@media (prefers-reduced-motion: no-preference) {
  .hero-title-phrase {
    animation: hero-title-enter .8s cubic-bezier(.22, 1, .36, 1) both;
  }
  .hero-title-first .hero-title-phrase:nth-of-type(2) { animation-delay: .14s; }
  .hero h1 > .hero-title-phrase { animation-delay: .28s; }
}
@keyframes hero-title-enter {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.proof-marquee, .proof-run { display: contents; }
.proof-repeat { display: none; }
.footer-home { display: block; padding: 0; background: transparent; border: 0; cursor: pointer; }
.hub-center[data-home], .hub-center-chip[data-home] { background: transparent; border: 0; cursor: pointer; }
[data-home]:focus-visible { outline: 3px solid var(--copper); outline-offset: 4px; }
@media (max-width: 899px) {
  body { overflow-wrap: anywhere; }
  .wrap > *, .wrap-wide > *, .detail-grid > *, .contact-grid > *,
  .footer-grid > *, .hero > *, .svc-card .top > * { min-width: 0; }

  .header-in { flex-wrap: nowrap; gap: 12px; }
  .header-right { gap: 8px; }
  nav.main { display: none; }
  .menu-btn { min-height: 44px; display: inline-flex !important; align-items: center; justify-content: center; }
  nav.mobile { max-height: calc(100vh - 180px - env(safe-area-inset-bottom)); max-height: calc(100dvh - 180px - env(safe-area-inset-bottom)); overflow-y: auto; overscroll-behavior: contain; }
  nav.mobile button.area-link, nav.mobile .call-row { min-height: 44px; }
  section[id] { scroll-margin-top: 100px; }

  button, a[href], input:not([type="hidden"]), select, textarea {
    min-width: 44px;
    min-height: 44px;
  }
  a[href] { display: inline-flex; align-items: center; max-width: 100%; }
  .phone-link, .top-strip, .hub-legend, .hub-chip .s, .hub-bubble .s,
  .proof-item span.txt, .proj-count, .form-note, .form-sent .s,
  .footer-bottom-in, .qe-intro, .qe-err, .chat-msg,
  .chat-chips button, .chat-wa, .chat-form button, .chat-btn {
    font-size: 16px;
  }
  button, input, select, textarea { font-size: max(16px, 1em); }
  .proof-item span.txt { white-space: normal; }
  .footer-grid li button, .footer-grid .f-link, .related button,
  .link-btn, .back-btn, .area-svc-list button { min-height: 44px; }
  .proj-nav, .social-link { width: 44px; height: 44px; }
  .chat-head button { flex-shrink: 0; }
  .chat-form, .qe-form { min-width: 0; }
  .field, .qe-field { min-width: 0; max-width: 100%; }

  img, video, iframe, embed, object { max-width: 100%; }
  img:not(.proj-photo img):not(.logo-btn img), video { height: auto; }
  iframe, embed, object { width: 100%; }
  iframe { aspect-ratio: 16 / 9; height: auto; }
  .mobile-bar-spacer { height: calc(56px + env(safe-area-inset-bottom)); }
}
@media (max-width: 899px) {
  .header-right {
    flex-shrink: 0;
    display: grid;
    grid-template-columns: auto auto;
    gap: 0 8px;
    align-items: center;
  }
  .header-right .phone-link {
    display: inline-flex;
    grid-column: 1 / -1;
    justify-self: end;
    font-size: 16px;
    min-height: 44px;
  }
  .btn-estimate-header { grid-column: 1; }
  .header-right .menu-btn { grid-column: 2; }
  .btn-estimate-header {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 12px;
    font-size: 14px;
    white-space: nowrap;
  }
}
@media (max-width: 359px) {
  .header-in { gap: 6px; padding-inline: 12px; }
  .header-right { gap: 6px; }
  .btn-estimate-header { padding-inline: 8px; }
}
@media (max-width: 559px) {
  /* Stacked trade chips stay readable and easy to tap on narrow phones. */
  .hub-radial { display: none; }
  .hub-stacked { display: block; }
  .hero-hub { width: 100%; }
  .hub-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Phone layouts: keep the introduction and actions ahead of the trade directory. */
@media (max-width: 639px) {
  .top-strip-in { padding-block: 8px; font-size: 12px; letter-spacing: .02em; }
  .header-in { padding-block: 10px; }
  .logo-btn img { height: 44px; }
  .menu-btn { width: 46px; height: 46px; font-size: 23px; }
  .hero { align-items: stretch; gap: 28px; padding-top: 28px; padding-bottom: 36px; }
  .hero-head { width: 100%; }
  .hero h1 { font-size: clamp(2.65rem, 11.5vw, 4rem); line-height: 1.02; }
  .hero p.rst-line { font-size: 1.25rem; margin-bottom: 16px; }
  .hero-rest { order: 2; width: 100%; }
  .hero-hub { order: 3; width: 100%; padding-top: 20px; border-top: 1px solid var(--border); }
  .hero p, .hero p.big { font-size: 17px; line-height: 1.6; }
  .hero .cta-row { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 24px; }
  .hero .cta-row .btn { width: 100%; min-height: 50px; }
  .hero .call-line { margin-top: 16px; font-size: 16px; gap: 6px; }
  .hub-radial { display: none; }
  .hub-stacked { display: block; }
  .hub-center-chip { width: 100%; padding: 0 12px 14px; opacity: 1; visibility: visible; animation: none !important; }
  .hub-center-chip img { width: 120px; }
  .hub-grid { gap: 12px; margin: 16px 2px 0; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hub-chip { aspect-ratio: auto; min-height: 92px; border-radius: 8px; padding: 14px 8px; box-shadow: none; }
  .hub-chip .n { font-size: 1.2rem; line-height: 1.15; }
  .hub-chip .s { font-family: var(--font-body); font-size: 13px; margin-top: 5px; }
  .hub-legend { font-size: 13px; margin-top: 18px; gap: 8px 16px; }
  section.pad, .contact-sec { padding-block: 40px; }
  .sec-title { font-size: clamp(2.1rem, 9vw, 2.8rem); }
  .lead { font-size: 17px; line-height: 1.6; }
  .col-grid, .area-grid { margin-top: 28px; gap: 24px; }
  .trade-cell { padding-right: 0; }
  .proof-group { width: 100%; justify-content: flex-start; gap: 14px; }
  .proof-item { width: 100%; }
  .form-panel { padding: 24px 18px; }
  .contact-grid { gap: 28px; }
  .contact-dl .row { font-size: 16px; }
  .contact-dl a, .footer-contact a { overflow-wrap: anywhere; }
  .footer-grid { padding-block: 32px; gap: 28px; }
  .faq-q .q { font-size: 22px; }
  .mobile-bar { box-shadow: 0 -3px 16px rgba(10,31,77,.12); }
  .mobile-bar a, .mobile-bar button { min-height: 56px; }
  .chat-panel { bottom: calc(68px + env(safe-area-inset-bottom)); max-height: calc(100dvh - 92px - env(safe-area-inset-bottom)); }
}

/* Keep mobile motion limited to the requested diagram and blue ribbon. */
@media (max-width: 1023px) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
  .hub-bubble, .hub-center, .hub-center-chip {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
  .hub-arrow { stroke-dashoffset: 0; }
  .hub-arrowhead { opacity: 1; }
}

.mobile-carousel-controls { display: none; }
@media (max-width: 1023px) {
  .hero-hub { display: block; order: 2; padding-top: 0; border-top: 0; }
  .hero-rest { order: 3; }
  .hero { gap: 16px; padding-top: 18px; }
  .hero-title-first { white-space: nowrap; }
  .hero-title-first br { display: none; }
  .hero h1 { font-size: clamp(1.4rem, 5.8vw, 3rem); line-height: 1.15; }
  .hero p.rst-line { font-size: 1rem; margin-bottom: 10px; }
  .hero-hub .hub-radial { display: block; max-width: min(320px, calc((100svh - 300px) / 1.1)); container-type: inline-size; }
  .hero-hub .hub-stacked { display: none; }
  .hero-hub .hub-bubble { width: 18%; min-width: 44px; min-height: 44px; padding: 2px; outline-width: 1.5px; box-shadow: none; transform: translate(-50%, -50%); }
  .hero-hub .hub-bubble .n { font-family: var(--font-display); font-size: 10px; font-size: clamp(9px, 3.5cqw, 11px); font-weight: 600; line-height: 1.05; overflow-wrap: normal; }
  .hero-hub .hub-bubble .s { display: none; }
  .hero-hub .hub-legend { font-size: 12px; line-height: 1.4; margin-top: 8px; gap: 4px 12px; }
  .hero-hub .hub-legend i { width: 10px; height: 10px; border-width: 2px; }
  .hero-hub .hub-center { padding: 10px 6px; }
  .hero-hub .hub-center img { width: 70%; }

  @media (prefers-reduced-motion: no-preference) {
    .hero-hub .hub-bubble {
      animation: mobile-trade-reveal .65s ease-out both !important;
    }
    .hero-hub .hub-bubble:nth-of-type(3n) { animation-delay: .15s !important; }
    .hero-hub .hub-bubble:nth-of-type(3n + 1) { animation-delay: .3s !important; }
    .hero-hub .hub-bubble:nth-of-type(3n + 2) { animation-delay: .45s !important; }
    .hero-hub .hub-center {
      animation: mobile-trade-reveal .7s ease-out both !important;
    }
    .hero-hub .hub-arrow {
      animation: mobile-trade-connect 1.5s .55s ease-out both !important;
    }
    .hero-hub .hub-arrowhead {
      animation: mobile-trade-tip .4s 1.7s ease-out both !important;
    }
  }

  .proof-in { display: block; overflow: hidden; }
  .proof-in .proof-group { display: contents; }
  .proof-in .proof-marquee { display: flex; width: max-content; }
  .proof-in .proof-run { display: flex; flex: none; align-items: center; gap: 16px; padding-right: 16px; }
  .proof-in .proof-item { flex: 0 0 calc((100vw - 56px) / 2); width: calc((100vw - 56px) / 2); min-width: 0; align-self: stretch; align-items: flex-start; padding-block: 4px; }
  .proof-in .proof-item span.txt { font-size: 13px; line-height: 1.4; white-space: normal; overflow-wrap: normal; }
  .proof-in .proof-ic { width: 20px; height: 20px; margin-top: 1px; }
  @media (min-width: 640px) {
    .proof-in .proof-item { width: calc((100vw - 72px) / 3); flex-basis: calc((100vw - 72px) / 3); }
    .proof-in .proof-item span.txt { font-size: 15px; }
  }
  @media (prefers-reduced-motion: no-preference) {
    .proof-in .proof-marquee { animation: proof-continuous 60s linear infinite !important; }
  }
  @media (prefers-reduced-motion: reduce) {
    .proof-in { overflow-x: auto; }
    .proof-in .proof-repeat { display: none; }
  }
  .trade-grid, .area-grid {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    padding: 4px 3px 16px;
    border-top: 0;
    margin-top: 24px;
  }
  .trade-grid > *, .area-grid > * {
    flex: 0 0 min(340px, 86%);
    min-width: 0;
    scroll-snap-align: start;
    border: 1px solid var(--border);
    border-top: 3px solid var(--copper);
    border-radius: 6px;
    padding: 22px 20px;
    background: #fff;
    text-align: left;
  }
  .area-grid > * { border-left: 1px solid var(--border); }
  .mobile-carousel-controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; }
  .mobile-carousel-controls span { color: var(--dim); font-size: 14px; }
  .mobile-carousel-controls button { width: 44px; height: 44px; border: 1px solid var(--border); border-radius: 50%; background: #fff; font-size: 26px; }
  .mobile-carousel-controls button:disabled { opacity: .35; cursor: default; }
}

@keyframes mobile-trade-reveal {
  from { opacity: 0; transform: translate(-50%, -50%) scale(.92); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@keyframes mobile-trade-connect {
  from { stroke-dashoffset: 100; }
  to { stroke-dashoffset: 0; }
}
@keyframes mobile-trade-tip {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes proof-continuous {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* Center the opening composition while retaining a left-aligned headline. */
@media (max-width: 1023px) {
  .hero-head { width: fit-content; max-width: 100%; margin-inline: auto; }
}
