/*
 * Bimmate concept v5.21 — deliberately simplified mobile layer.
 *
 * This file is loaded last. It does not redesign desktop; it replaces the
 * overlapping generations of tablet/phone rules with one predictable mobile
 * presentation for phones in portrait and landscape.
 */

.v516-page .detail-hero__visual--product-flat {
  grid-template-columns: clamp(112px, 11vw, 148px) minmax(0, 1fr);
}

.v516-page .product-platform-marks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: 10px;
}

.v516-page .detail-hero__visual--product-flat .product-platform-mark {
  width: 100%;
}

@media (max-width: 900px), (hover: none) and (pointer: coarse) and (max-width: 1180px) {
  html {
    scroll-padding-top: 88px;
  }

  body.v516-page {
    overflow-x: hidden;
    background: var(--v516-cream);
  }

  .v516-page {
    --shell: min(calc(100% - 40px), 720px);
    --v516-panel-gutter: 8px;
    --v516-panel-radius: 16px;
    --v516-panel-gap: 14px;
    --footer-curve-height: 62px;
  }

  .v516-page *,
  .v516-page *::before,
  .v516-page *::after {
    max-width: 100%;
  }

  .v516-page img,
  .v516-page video,
  .v516-page iframe {
    height: auto;
  }

  .v516-page .shell {
    width: var(--shell);
  }

  .v516-page .has-js .reveal,
  .has-js .v516-page .reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: opacity .38s ease !important;
  }

  .v516-page .pointer-react,
  .v516-page [data-pointer-react] {
    --pointer-shift-x: 0px !important;
    --pointer-shift-y: 0px !important;
  }

  .brand-observer,
  .tech-divider,
  .hero-axis,
  .hero-lines,
  .service-route,
  .detail-hero__lines {
    display: none !important;
  }

  .concept-bar {
    min-height: 28px;
    padding-inline: 16px;
    font-size: 9px;
  }

  .concept-bar__detail {
    display: none;
  }

  .site-header {
    position: sticky;
    top: 0;
  }

  .nav {
    min-height: 66px;
    gap: 16px;
  }

  .brand {
    width: 148px;
  }

  .nav-toggle {
    display: block;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
  }

  .nav-menu {
    position: fixed;
    inset: 102px 10px auto;
    max-height: calc(100dvh - 116px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 14px;
    border-radius: 14px;
  }

  .nav-menu > a:not(.button),
  .nav-services__toggle {
    min-height: 46px;
    display: flex;
    align-items: center;
    padding: 11px 8px;
    font-size: 14px;
  }

  .nav-menu > a.nav-product-link {
    min-height: 48px;
    margin-block: 7px 3px;
    padding: 11px 12px;
  }

  .nav-services.is-open .nav-services__panel {
    max-height: 330px;
  }

  .nav-services__panel a {
    min-height: 42px;
    display: flex;
    align-items: center;
  }

  .nav-menu .button {
    width: 100%;
    min-height: 46px;
    margin-top: 10px;
  }

  .v516-page :is(h1, .detail-hero__copy h1, .legal-hero h1, .contact-hero h1) {
    max-width: 100%;
    font-size: clamp(42px, 12.5vw, 52px) !important;
    line-height: .98;
    letter-spacing: -.045em;
    overflow-wrap: normal;
  }

  .v516-page :is(
    .section-heading h2,
    .compact-heading h2,
    .page-cta h2,
    .story-step__copy h2,
    .legal-contact h2,
    .contact-options h2,
    .project-list-proof-browser__heading h2
  ) {
    max-width: 100%;
    font-size: clamp(34px, 10vw, 42px) !important;
    line-height: 1.02;
    letter-spacing: -.035em;
  }

  .v516-page h3 {
    overflow-wrap: anywhere;
  }

  .v516-page :is(.hero-lead, .detail-hero__lead) {
    margin-top: 22px;
    font-size: 16px;
    line-height: 1.62;
  }

  .v516-page :is(.section, .page-section) {
    min-height: 0;
    padding: 58px 0;
  }

  .v516-page :is(.section-heading, .section-heading--compact, .compact-heading) {
    grid-template-columns: 1fr;
    gap: 18px;
    margin-bottom: 38px;
  }

  .v516-page :is(.section-heading, .compact-heading) > p {
    max-width: 38rem;
    margin: 0;
    font-size: 15px;
    line-height: 1.6;
  }

  .eyebrow {
    margin-bottom: 18px;
    font-size: 9px;
  }

  .button,
  .text-link,
  button,
  select {
    min-height: 44px;
  }

  .v516-page :is(
    .scroll-story,
    .home-services,
    .scan-story,
    .detail-hero--ink,
    .editorial-section--ink,
    .portfolio-section--ink,
    .matterport-detail,
    .matterport-showcase,
    .detail-cta--ink,
    .legal-contact,
    .page-section--ink,
    .page-cta:not(:has(.page-cta__grid--light))
  )::before {
    inset-inline: var(--v516-panel-gutter);
    border-radius: var(--v516-panel-radius);
  }

  /* Homepage: one calm promise, no 3D or cinematic mechanics. */
  .v516-home .hero {
    min-height: 0;
    display: block;
    padding: 50px 0 58px;
    overflow: visible;
  }

  .v516-home .hero-grid {
    display: block;
  }

  .v516-home .hero-copy {
    max-width: none;
  }

  .v516-home :is(.hero-imprint, .motion-bim3d-stage) {
    display: none !important;
  }

  .v516-home .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 10px;
    margin-top: 28px;
  }

  .v516-home .hero-actions .button {
    width: 100%;
  }

  .v516-home .hero-actions .text-link {
    width: fit-content;
    padding-block: 6px;
  }

  .v516-home .hero-service-line {
    display: none;
  }

  .v516-home .trust-strip {
    min-height: 0;
    padding: 18px 0 30px;
  }

  .v516-home .trust-grid {
    display: grid;
    grid-template-columns: 1fr;
    border-top: 1px solid var(--line);
  }

  .v516-home .trust-grid > div,
  .v516-home .trust-grid > div:nth-child(2),
  .v516-home .trust-grid > div:nth-child(3) {
    min-height: 0;
    justify-content: flex-start;
    gap: 13px;
    padding: 13px 0;
    border-bottom: 1px solid var(--line);
  }

  .v516-home .trust-grid strong {
    width: 58px;
    flex: 0 0 58px;
    font-size: 16px;
  }

  .v516-home .trust-grid span {
    white-space: normal;
    font-size: 13px;
  }

  .v516-home .scroll-story {
    min-height: 0;
    padding: 48px 0 8px;
  }

  .v516-home .scroll-story__sticky {
    display: none !important;
  }

  .v516-home .story-sequence {
    margin-top: 0;
  }

  .v516-home .story-step,
  .v516-home .story-step.is-active {
    min-height: 0;
    width: 100%;
    display: block;
    padding: 0 0 44px;
    opacity: 1;
    transform: none;
  }

  .v516-home .story-step__mobile {
    display: block;
    width: 100%;
    height: 172px;
    margin: 0 0 22px;
    padding: 0;
    border: 1px solid rgba(255, 250, 246, .12);
    border-radius: 8px;
    background: #111118;
    object-fit: cover;
    filter: saturate(.62) contrast(.94);
  }

  .v516-home .story-step:nth-child(1) .story-step__mobile,
  .v516-home .story-step:nth-child(3) .story-step__mobile,
  .v516-home .story-step:nth-child(4) .story-step__mobile {
    padding: 10px;
    background: #ece8e3;
    object-fit: contain;
    mix-blend-mode: normal;
    opacity: .9;
  }

  .v516-home .story-step:nth-child(4) .story-step__mobile {
    background: #252531;
  }

  .v516-home .story-step__copy {
    max-width: none;
    padding: 0;
    border-left: 0;
    text-shadow: none;
  }

  .v516-home .story-chapter {
    margin-bottom: 13px;
  }

  .v516-home .story-step__copy > p:not(.story-chapter) {
    margin-top: 16px;
    font-size: 15px;
    line-height: 1.62;
  }

  .v516-home .story-link {
    margin-top: 18px;
  }

  .v516-home .service-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
  }

  .v516-home .service-card {
    display: block;
    padding: 25px 0;
    border-top: 1px solid rgba(255, 250, 246, .15);
  }

  .v516-home .service-card:last-child {
    border-bottom: 1px solid rgba(255, 250, 246, .15);
  }

  .v516-home .service-image {
    display: none;
  }

  .v516-home .service-copy {
    min-height: 0;
  }

  .v516-home .service-copy h3 {
    margin-top: 13px;
    font-size: 27px;
  }

  .v516-home .service-copy p {
    margin: 12px 0 18px;
    font-size: 14px;
    line-height: 1.58;
  }

  .v516-home .addin-editorial {
    display: block;
  }

  .v516-home .addin-editorial__lead {
    position: static;
  }

  .v516-home .addin-editorial__lead h2 {
    font-size: clamp(36px, 10vw, 44px);
  }

  .v516-home .addin-editorial__lead > p:not(.eyebrow) {
    margin: 20px 0 26px;
    font-size: 15px;
  }

  .v516-home .home-tool-index {
    margin-top: 38px;
  }

  .v516-home .home-tool-index > section {
    display: block;
    padding: 19px 0;
  }

  .v516-home .home-tool-index > section h3 {
    margin-top: 8px;
    font-size: 18px;
    line-height: 1.35;
  }

  .v516-home .project-preview-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .v516-home .project-preview figure {
    aspect-ratio: 4 / 3;
  }

  .v516-home .final-cta__inner {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  /* Shared detail pages: a predictable one-column document flow. */
  .v516-page .detail-hero {
    min-height: 0;
    display: block;
    padding: 48px 0 58px;
    overflow: visible;
  }

  .v516-page .detail-hero__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .v516-page .detail-hero__copy {
    order: 1;
    max-width: none;
  }

  .v516-page .detail-hero__visual {
    order: 2;
    width: 100%;
    min-height: 0 !important;
    height: auto !important;
    margin: 0;
    transform: none !important;
  }

  .v516-page .detail-hero__visual img {
    width: 100%;
    min-height: 0 !important;
    height: auto !important;
    max-height: 260px;
    object-fit: contain;
  }

  .v516-page .detail-hero__visual--portrait-flat,
  .v516-page .detail-hero__visual--portrait-flat img {
    min-height: 0 !important;
    height: auto !important;
    max-height: 360px;
  }

  .v516-page .detail-hero__visual--product-flat {
    min-height: 0 !important;
    height: auto !important;
  }

  .v516-page .detail-hero__visual--product-flat img {
    max-height: none;
  }

  .v516-page .detail-hero__caption {
    position: static;
    padding: 10px 0 0;
    background: transparent;
    color: inherit;
    font-size: 9px;
  }

  .v516-page .detail-hero__actions {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 10px;
    margin-top: 28px;
  }

  .v516-page .detail-hero__actions .button {
    width: 100%;
  }

  .v516-page .detail-hero__actions .text-link {
    width: fit-content;
    padding-block: 6px;
  }

  .service-summary-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
  }

  .service-summary {
    min-height: 0;
    display: block;
    padding: 24px 28px 24px 0;
    border-top: 1px solid var(--v516-rule);
  }

  .service-summary:last-child {
    border-bottom: 1px solid var(--v516-rule);
  }

  .service-summary .media-surface {
    display: none;
  }

  .service-summary h3 {
    margin-top: 12px;
    font-size: 27px;
  }

  .service-summary p {
    margin-top: 10px;
    font-size: 14px;
    line-height: 1.58;
  }

  .service-summary > i {
    right: 2px;
    bottom: 25px;
  }

  .capability-grid,
  .capability-grid--three,
  .work-grid,
  .work-grid--three,
  .work-grid--four,
  .split-proof,
  .page-cta__grid,
  .contact-options__grid {
    grid-template-columns: 1fr !important;
  }

  .capability-card,
  .contact-option {
    min-height: 0;
    padding: 25px 0;
    border-right: 0;
    border-bottom: 1px solid var(--v516-rule);
  }

  .work-grid {
    gap: 34px;
  }

  .work-card figure,
  .media-surface {
    min-height: 0;
    aspect-ratio: 4 / 3;
  }

  .work-card figure img,
  .media-surface img {
    width: 100%;
    height: 100%;
    max-height: none;
    object-fit: contain;
  }

  .page-cta {
    padding: 58px 0;
  }

  .page-cta__grid {
    gap: 24px;
  }

  .page-cta .button {
    width: 100%;
  }

  /* 3D scans: keep media usable, but never taller than the phone. */
  .matterport-showcase,
  .matterport-detail,
  .scan-video-section {
    padding: 58px 0;
  }

  .matterport-showcase .compact-heading {
    margin-bottom: 28px;
  }

  .matterport-gate,
  .matterport-frame,
  .matterport-shell,
  .matterport-shell--project {
    min-height: 0 !important;
    aspect-ratio: 16 / 10;
  }

  .matterport-frame iframe {
    width: 100%;
    height: 100%;
  }

  .matterport-gate__action {
    inset: auto 14px 14px;
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .matterport-gate__action button {
    width: 100%;
  }

  .matterport-footer {
    min-height: 0;
    padding: 12px 14px;
  }

  .matterport-footer img,
  .matterport-qr {
    display: none;
  }

  .scan-video-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .scan-video-grid video {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
  }

  /* BIM-MATE: keep the complete text catalogue, omit the duplicate gallery. */
  .v516-product .product-showcase {
    display: none;
  }

  .v516-product .product-facts {
    grid-template-columns: 1fr;
  }

  .v516-product .product-facts > div {
    padding: 18px 0;
    border-right: 0;
    border-bottom: 1px solid var(--v516-rule);
  }

  .v516-product .product-journey article {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 12px;
    padding: 24px 0;
  }

  .v516-product .product-journey small {
    grid-column: 2;
    margin-top: 8px;
  }

  .v516-product .product-group-nav {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    border: 1px solid var(--v516-rule-light);
  }

  .v516-product .product-group-nav a,
  .v516-product .product-group-nav a:nth-child(2n) {
    min-width: 150px;
    flex: 0 0 150px;
    scroll-snap-align: start;
    padding: 17px 15px;
    border-right: 1px solid var(--v516-rule-light);
    border-bottom: 0;
  }

  .v516-product .tool-catalog {
    padding: 58px 0;
  }

  .v516-product .tool-catalog__group {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 34px 0;
  }

  .v516-product .tool-catalog__group h3 {
    font-size: 30px;
  }

  .v516-product .tool-catalog__group header > p {
    margin-top: 12px;
    font-size: 14px;
  }

  .v516-product .tool-catalog__group dl > div {
    grid-template-columns: 1fr;
    gap: 9px;
    padding: 19px 0;
  }

  .v516-product .tool-catalog__group dt {
    font-size: 16px;
  }

  .v516-product .tool-catalog__icon {
    width: 25px;
    height: 25px;
  }

  .v516-product .tool-catalog__group dd p {
    margin-top: 6px;
    font-size: 14px;
    line-height: 1.58;
  }

  /* Projects: one calm image per category; the detailed list remains desktop-only. */
  .v516-projects .project-category-switcher {
    position: static;
    margin-bottom: 34px;
    padding: 20px 0 0;
    box-shadow: none;
  }

  .v516-projects .project-category-tabs {
    display: grid;
    grid-template-columns: 1fr;
    overflow: visible;
    border: 1px solid var(--project-list-rule);
    border-radius: 10px;
  }

  .v516-projects .project-category-tab {
    width: 100%;
    min-width: 0;
    min-height: 48px;
    padding: 11px 14px;
    border-right: 0;
    border-bottom: 1px solid var(--project-list-rule);
    text-align: left;
  }

  .v516-projects .project-category-tab:last-child {
    border-bottom: 0;
  }

  .v516-projects .project-category-tab span {
    font-size: 15px;
  }

  .v516-projects .project-category-tab small {
    display: none;
  }

  .v516-projects .project-list-proof-browser {
    padding: 44px 0 70px;
  }

  .v516-projects .project-list-proof-browser__heading {
    grid-template-columns: 1fr;
    gap: 18px;
    margin-bottom: 32px;
  }

  .v516-projects .project-list-proof-browser__heading > p {
    font-size: 14px;
    line-height: 1.58;
  }

  .v516-projects .project-list-proof-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    height: auto;
    min-height: 0;
  }

  .mobile-project-carousel-ready .project-list-proof-index {
    display: none;
  }

  .v516-projects .project-list-proof-viewer {
    position: static;
    grid-row: 2;
    top: auto;
  }

  .v516-projects .project-list-proof-viewer__sticky {
    position: static;
    min-height: 0;
    display: grid;
    grid-template-rows: auto auto;
    padding: 12px;
    border-radius: 10px;
    box-shadow: none;
  }

  .v516-projects .project-list-proof-showcase {
    grid-template-rows: auto auto;
  }

  .v516-projects .project-list-proof-stage {
    min-height: 0;
    aspect-ratio: 4 / 3;
    touch-action: pan-y;
    user-select: none;
  }

  .v516-projects .project-list-proof-layer {
    transition:
      opacity .72s ease,
      transform .95s cubic-bezier(.2, .72, .22, 1);
  }

  .v516-projects .project-list-proof-caption h3 {
    font-size: 27px;
  }

  .v516-projects .project-walkthrough-section {
    padding: 58px 0;
  }

  .v516-projects .project-matterport {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .v516-projects .project-walkthrough-section .matterport-shell--project {
    margin: 0;
    box-shadow: none;
  }

  /* Legal, contact and footer stay documents rather than visual chapters. */
  .legal-hero,
  .contact-hero {
    min-height: 0;
    padding: 50px 0 58px;
  }

  .legal-section,
  .legal-contact,
  .contact-options {
    padding: 58px 0;
  }

  .legal-layout,
  .legal-contact__inner,
  .contact-options__grid {
    grid-template-columns: 1fr;
    gap: 34px;
  }

  .legal-index {
    position: static;
    max-height: none;
    padding: 18px;
    overflow: visible;
  }

  .legal-index nav {
    grid-template-columns: 1fr;
  }

  .legal-article {
    padding-bottom: 38px;
  }

  .legal-article + .legal-article {
    padding-top: 38px;
  }

  .legal-article p,
  .legal-article li {
    font-size: 14px;
    line-height: 1.72;
  }

  .contact-option h2 {
    margin-top: 18px;
    font-size: 29px;
  }

  .v516-page .footer {
    margin-top: var(--footer-curve-height);
    padding: 62px 0 20px;
  }

  .v516-page .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .v516-page .footer-brand {
    grid-column: auto;
  }

  .v516-page .footer-brand img {
    width: 170px;
  }

  .v516-page .footer-grid > div:not(.footer-brand) {
    gap: 8px;
  }

  .v516-page .footer-bottom {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    margin-top: 40px;
  }

  .clarity-consent {
    inset: auto 10px 10px !important;
    padding: 16px !important;
    border-radius: 14px !important;
  }
}

@media (max-width: 600px) {
  .v516-page {
    --shell: calc(100% - 32px);
    --v516-panel-gutter: 6px;
    --footer-curve-height: 52px;
  }

  .v516-page :is(h1, .detail-hero__copy h1, .legal-hero h1, .contact-hero h1) {
    font-size: clamp(40px, 12.2vw, 49px) !important;
  }

  .v516-home .story-step__mobile {
    height: 156px;
  }

  .matterport-gate,
  .matterport-frame,
  .matterport-shell,
  .matterport-shell--project {
    aspect-ratio: 4 / 3;
  }
}

@media (max-width: 760px) {
  .climate-tool-section {
    padding-right: 0;
    padding-left: 0;
  }

  .climate-tool-shell {
    margin-top: 28px;
    padding: 6px;
    border-radius: 16px;
  }

  .climate-tool-shell__bar {
    min-height: 44px;
    padding: 0 10px;
  }

  .climate-tool-shell__bar span:last-child {
    display: none;
  }

  .climate-tool-frame {
    border-radius: 11px;
  }

  .climate-tool-frame iframe {
    height: 340px;
  }

  .climate-tool-shell__footer {
    min-height: 0;
    padding: 15px 10px 12px;
  }

  .climate-tool-shell__footer p {
    font-size: 12px;
  }

  .climate-tool-shell .text-link--light {
    white-space: normal;
  }
}

@media (prefers-reduced-motion: reduce) {
  .v516-page .reveal,
  .v516-page .story-step,
  .v516-page .project-list-proof-layer {
    transition: none !important;
    transform: none !important;
  }
}
