/* =========================================================
   VALLEY FORGE BUILDERS — mobile navigation and page polish
   Shared by the localized homepages and all injected headers.
   ========================================================= */

.mobile-nav-toggle,
.mobile-nav-panel,
.mobile-nav-scrim { display: none; }

@media (max-width: 1099px) {
  :root { --mobile-header-h: 64px; --mobile-action-h: 76px; }

  html.mobile-menu-open,
  body.mobile-menu-open { overflow: hidden; }

  body[data-page] {
    padding-top: var(--mobile-header-h);
    padding-bottom: calc(var(--mobile-action-h) + env(safe-area-inset-bottom, 0px));
  }

  body[data-page="home"] { padding-top: 0; }

  .vf-page-shell { padding-top: var(--mobile-header-h) !important; }

  .site-header {
    height: var(--mobile-header-h);
    min-height: var(--mobile-header-h);
    background: rgba(246, 242, 236, 0.96) !important;
    box-shadow: 0 8px 30px rgba(14, 26, 43, 0.06);
  }

  .site-header__inner,
  .site-header > div {
    min-height: calc(var(--mobile-header-h) - 1px);
    padding: 8px 16px !important;
    flex-wrap: nowrap !important;
    gap: 12px !important;
  }

  .site-header .brand,
  .site-header__inner > a:first-of-type {
    min-width: 0;
    max-width: calc(100% - 94px);
    min-height: 44px;
    gap: 9px !important;
  }

  .site-header .brand__logo,
  .site-header__inner > a:first-of-type > img {
    width: 28px !important;
    height: 28px !important;
    flex: 0 0 28px;
  }

  .site-header .brand__name,
  .site-header__inner > a:first-of-type > span {
    min-width: 0;
    font-size: 15px !important;
    line-height: 1 !important;
    letter-spacing: 0.025em !important;
    white-space: nowrap;
  }

  .site-header .brand__name small,
  .site-header__inner > a:first-of-type > span small {
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 8px !important;
    letter-spacing: 0.16em !important;
    margin-top: 4px !important;
  }

  .site-header .nav,
  .site-header nav[aria-label="Primary"] { display: none !important; }

  .mobile-nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 82px;
    height: 44px;
    padding: 0 12px;
    flex: 0 0 auto;
    border: 1px solid #0E1A2B;
    color: #0E1A2B;
    background: transparent;
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 9.5px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    transition: background .22s ease, color .22s ease;
  }

  .mobile-nav-toggle[aria-expanded="true"] {
    background: #0E1A2B;
    color: #F6F2EC;
  }

  .mobile-nav-toggle__icon {
    position: relative;
    width: 16px;
    height: 12px;
    flex: 0 0 16px;
  }

  .mobile-nav-toggle__icon::before,
  .mobile-nav-toggle__icon::after {
    content: "";
    position: absolute;
    left: 0;
    width: 16px;
    height: 1.5px;
    background: currentColor;
    transform-origin: center;
    transition: transform .22s ease, top .22s ease;
  }

  .mobile-nav-toggle__icon::before { top: 2px; }
  .mobile-nav-toggle__icon::after { top: 9px; }
  .mobile-nav-toggle[aria-expanded="true"] .mobile-nav-toggle__icon::before { top: 5px; transform: rotate(45deg); }
  .mobile-nav-toggle[aria-expanded="true"] .mobile-nav-toggle__icon::after { top: 5px; transform: rotate(-45deg); }

  .mobile-nav-scrim {
    display: block;
    position: fixed;
    top: var(--mobile-header-h);
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 57;
    width: 100%;
    background: rgba(14, 26, 43, 0.46);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .28s ease, visibility .28s ease;
  }

  .mobile-nav-panel {
    display: block;
    position: fixed;
    top: var(--mobile-header-h);
    right: 0;
    bottom: 0;
    z-index: 58;
    width: min(100%, 430px);
    overflow-y: auto;
    overscroll-behavior: contain;
    background: #F6F2EC;
    color: #0E1A2B;
    transform: translateX(102%);
    visibility: hidden;
    box-shadow: -22px 0 54px rgba(14, 26, 43, 0.16);
    transition: transform .32s cubic-bezier(.22,.78,.22,1), visibility .32s ease;
  }

  .mobile-menu-open .mobile-nav-scrim {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .mobile-menu-open .mobile-nav-panel {
    transform: translateX(0);
    visibility: visible;
  }

  .mobile-nav-panel__inner {
    min-height: 100%;
    padding: 30px 24px calc(34px + env(safe-area-inset-bottom, 0px));
    display: flex;
    flex-direction: column;
  }

  .mobile-nav-panel__eyebrow {
    margin: 0 0 14px;
    color: #8A6220;
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 9.5px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
  }

  .mobile-nav-links {
    display: grid;
    border-top: 1px solid #D9D2C5;
  }

  .mobile-nav-links a {
    min-height: 66px;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 18px;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid #D9D2C5;
    color: #0E1A2B;
  }

  .mobile-nav-links a[aria-current="page"] { color: #8A6220; }
  .mobile-nav-links__num {
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 9px;
    letter-spacing: .08em;
    color: #8A6220;
  }
  .mobile-nav-links__label {
    font-family: "Cormorant Garamond", "Times New Roman", serif;
    font-size: 30px;
    font-weight: 500;
    line-height: 1;
  }
  .mobile-nav-links__arrow { font-size: 18px; color: #8A6220; }

  .mobile-nav-panel__meta {
    margin-top: 32px;
    display: grid;
    gap: 10px;
  }

  .mobile-nav-language {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
    border: 1px solid #D9D2C5;
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 10px;
    letter-spacing: .14em;
    text-transform: uppercase;
  }

  .mobile-nav-language span:last-child { color: #8A6220; }

  .mobile-nav-phone {
    min-height: 68px;
    display: grid;
    align-content: center;
    gap: 4px;
    padding: 11px 16px;
    background: #0E1A2B;
    color: #F6F2EC;
  }

  .mobile-nav-phone small {
    color: #B8B0A0;
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 8.5px;
    letter-spacing: .16em;
    text-transform: uppercase;
  }

  .mobile-nav-phone strong {
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 17px;
    font-weight: 500;
    letter-spacing: .05em;
  }

  .mobile-nav-cta {
    min-height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    background: #B98A3A;
    color: #0E1A2B;
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 10px;
    letter-spacing: .14em;
    text-transform: uppercase;
    text-align: center;
  }

  #vfMobileBar {
    display: grid !important;
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    z-index: 80;
    grid-template-columns: minmax(0, .95fr) minmax(0, 1.25fr);
    gap: 8px;
    padding: 0;
    background: transparent !important;
    border: 0 !important;
    pointer-events: none;
    transition: transform .25s ease, opacity .25s ease;
  }

  #vfMobileBar a {
    min-width: 0;
    min-height: 56px !important;
    padding: 0 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #D9D2C5;
    background: rgba(246, 242, 236, .97) !important;
    color: #0E1A2B !important;
    box-shadow: 0 10px 28px rgba(14, 26, 43, .18);
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 9px !important;
    letter-spacing: .055em !important;
    line-height: 1.25;
    text-transform: uppercase;
    text-align: center;
    white-space: nowrap;
    pointer-events: auto;
  }

  #vfMobileBar a:last-child {
    border-color: #0E1A2B;
    background: #0E1A2B !important;
    color: #F6F2EC !important;
    font-size: 9.5px !important;
    letter-spacing: .11em !important;
  }

  .mobile-menu-open #vfMobileBar {
    opacity: 0;
    transform: translateY(120%);
    pointer-events: none;
  }

  .section { padding: 56px 0; }
  .section--tight { padding: 44px 0; }

  .site-footer { padding-bottom: calc(52px + env(safe-area-inset-bottom, 0px)); }
}

@media (max-width: 620px) {
  .vf-home-hero { min-height: auto !important; align-items: flex-start !important; }
  .vf-home-hero__content { padding: 48px 20px 170px !important; }
  .vf-home-hero__eyebrow { margin-bottom: 18px !important; font-size: 9px !important; letter-spacing: .17em !important; line-height: 1.65; }
  .vf-home-hero h1 { font-size: 42px !important; line-height: 1.02 !important; margin-bottom: 22px !important; }
  html[lang^="zh"] .vf-home-hero h1 { font-size: 40px !important; line-height: 1.12 !important; }
  .vf-home-hero__lede { margin-bottom: 26px !important; font-size: 16px !important; line-height: 1.62 !important; }
  .vf-home-hero__actions { display: grid !important; grid-template-columns: 1fr; gap: 10px !important; }
  .vf-home-hero__actions a { width: 100%; min-height: 54px !important; padding: 0 18px !important; }
  .vf-home-hero__trust { margin-top: 18px !important; font-size: 9px !important; letter-spacing: .08em !important; line-height: 1.75 !important; }
  .vf-home-hero__location { bottom: 84px !important; justify-content: flex-start !important; }
  .vf-home-hero__location > span:last-child { font-size: 8px !important; letter-spacing: .1em !important; white-space: normal !important; }

  .vf-home-stats > div > div { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .vf-home-stats > div > div > div {
    min-width: 0;
    padding: 22px 14px !important;
    border-left: 0 !important;
    border-right: 0 !important;
    border-bottom: 0 !important;
  }
  .vf-home-stats > div > div > div:nth-child(odd) { border-right: 1px solid #D9D2C5 !important; }
  .vf-home-stats > div > div > div:nth-child(n + 3) { border-top: 1px solid #D9D2C5 !important; }
  .vf-home-stats > div > div > div > span:first-child { font-size: 32px !important; }
  .vf-home-stats > div > div > div:last-child > span:first-child { font-size: 22px !important; }

  .page-hero h1 { font-size: 42px; }
  .page-hero .lede { font-size: 16px; line-height: 1.62; }
  body[data-page="process"] .page-hero { min-height: auto; }
  body[data-page="process"] .page-hero__inner { padding: 48px 20px 58px; }
  body[data-page="process"] .page-hero h1 { line-height: 1.08; margin: 0 0 26px; }
  body[data-page="process"] .page-hero__lede { font-size: 16px; line-height: 1.65; }
  .project-index-intro .project-section-head,
  .project-section-head--completed { gap: 12px; }
  .project-index-intro h1 { font-size: 42px; }
}

@media (max-width: 360px) {
  .site-header .brand__name,
  .site-header__inner > a:first-of-type > span { font-size: 13.5px !important; }
  .mobile-nav-toggle { min-width: 74px; padding: 0 10px; }
  #vfMobileBar { left: 8px; right: 8px; gap: 6px; }
  #vfMobileBar a { font-size: 8.2px !important; }
}

@media (prefers-reduced-motion: reduce) {
  .mobile-nav-panel,
  .mobile-nav-scrim,
  .mobile-nav-toggle,
  #vfMobileBar { transition: none !important; }
}
