/* Mobile navigation uses the existing Unlimitech palette and stays isolated
   from the desktop mega menu. */
@media (max-width: 1320px) {
  body {
    --ulm-mobile-grid-width: var(--ulm-content-width, 1140px);
    --ulm-mobile-grid-gutter: var(--ulm-content-gutter, 32px);
  }
  /* Match the header's content to the existing page grid, not the
     full-bleed section background. Leave the desktop header unchanged. */
  html body #mfn-header-template section.mcb-section-1v3y67hdq {
    padding-inline: 0 !important;
  }
  html body #mfn-header-template .mfn-header-tmpl-builder > .section > .section_wrapper {
    width: min(var(--ulm-mobile-grid-width), calc(100% - 2 * var(--ulm-mobile-grid-gutter))) !important;
    max-width: none !important;
    margin-inline: auto !important;
  }
  html body #mfn-header-template .mcb-wrap-inner-9rffb1lx8 {
    padding-inline: 0 !important;
  }
  /* A single mobile-header layout from phone sizes through 1320px. */
  html body #mfn-header-template .column_header_menu { display: none !important; }
  html body #mfn-header-template .column_header_logo { margin-right: auto !important; }
  html body #mfn-header-template .column_header_burger {
    display: block !important;
    margin-left: 0 !important;
  }
  html body #mfn-header-template .ulm-theme-column { margin: 0 8px 0 0 !important; }
  html body #mfn-header-template .mcb-column-inner-fbt8bu5i {
    margin-left: 10px !important;
    margin-right: 0 !important;
  }
  /* Elementor can retain a stale viewport width after the cookie dialog
     closes. The main page builder is already full width on this site. */
  html body.page #Content .the_content > .section_wrapper:has(> .the_content_wrapper.is-elementor) {
    width: 100% !important;
    max-width: none !important;
    margin-inline: 0 !important;
    padding-inline: 0 !important;
  }
  html body.page #Content .the_content_wrapper.is-elementor > .elementor > .elementor-top-section.elementor-section-stretched {
    width: 100% !important;
    left: 0 !important;
  }
  /* The blog listing and post hero use BeTheme wrappers rather than the
     Elementor grid, so connect their outer content to the same grid. */
  html body.page-id-697 #Content .the_content > .section_wrapper {
    width: min(var(--ulm-mobile-grid-width), calc(100% - 2 * var(--ulm-mobile-grid-gutter))) !important;
    max-width: none !important;
    margin-inline: auto !important;
    padding-inline: 0 !important;
  }
  html body.page-id-697 #Content .the_content_wrapper {
    width: 100% !important;
    margin-inline: 0 !important;
  }
  html body.page-id-697 #Content .ulm-blog {
    max-width: none !important;
    padding-inline: 0 !important;
  }
  html body.page-id-697 #Content .ulm-blog .ulm-blog-grid {
    width: 100% !important;
    left: auto !important;
    transform: none !important;
  }
  html body.single-post .ulm-post-hero {
    padding-inline: 0 !important;
  }
  html body.single-post .ulm-post-hero-inner {
    width: min(var(--ulm-mobile-grid-width), calc(100% - 2 * var(--ulm-mobile-grid-gutter))) !important;
    max-width: none !important;
  }
  html body.single-post #Content .the_content_wrapper .ulm-related-posts {
    width: min(var(--ulm-mobile-grid-width), calc(100vw - 2 * var(--ulm-mobile-grid-gutter))) !important;
    margin-inline: 0 !important;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
  }
  html body .ulm-mobile-nav {
    --ulm-mobile-bg: #fff;
    --ulm-mobile-text: #07012d;
    --ulm-mobile-muted: #536078;
    --ulm-mobile-border: rgba(7, 1, 45, .12);
    --ulm-mobile-accent: #0068ff;
    --ulm-mobile-logo-bg: #e8eaf0;
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    box-sizing: border-box;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    background: var(--ulm-mobile-bg);
    color: var(--ulm-mobile-text);
    font-family: inherit;
    animation: ulm-mobile-nav-enter .18s ease both;
  }
  html[data-ulm-theme=dark] body .ulm-mobile-nav {
    --ulm-mobile-bg: #101119;
    --ulm-mobile-text: #f3f4f8;
    --ulm-mobile-muted: #c0c2cf;
    --ulm-mobile-border: rgba(255, 255, 255, .14);
    --ulm-mobile-accent: #76adff;
  }
  html body .ulm-mobile-nav * { box-sizing: border-box; }
  html body .ulm-mobile-nav-scroll {
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  }
  html body .ulm-mobile-nav-header {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: calc(68px + env(safe-area-inset-top));
    padding: calc(12px + env(safe-area-inset-top))
      max(var(--ulm-mobile-grid-gutter), calc((100% - var(--ulm-mobile-grid-width)) / 2)) 11px;
    border-bottom: 1px solid var(--ulm-mobile-border);
    background: var(--ulm-mobile-bg);
  }
  html body .ulm-mobile-nav-header-title {
    min-width: 0;
    color: var(--ulm-mobile-text);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: .02em;
    line-height: 1.25;
    overflow-wrap: anywhere;
  }
  html body .ulm-mobile-nav-brand {
    display: block;
    width: 152px;
    max-width: 100%;
    height: auto;
  }
  html[data-ulm-theme=dark] body .ulm-mobile-nav-brand {
    filter: brightness(0) invert(1);
  }
  html body .ulm-mobile-nav-header-path {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    min-width: 0;
    gap: 8px;
  }
  html body .ulm-mobile-nav-back {
    display: inline-flex !important;
    flex: 0 0 40px;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 44px;
    margin: 0 0 0 -8px !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    color: var(--ulm-mobile-text) !important;
    box-shadow: none !important;
    cursor: pointer;
  }
  html body .ulm-mobile-nav-back[hidden] { display: none !important; }
  html body .ulm-mobile-nav-back svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  html body .ulm-mobile-nav-header-controls {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 8.5px;
    margin-right: -9.5px;
  }
  html body .ulm-mobile-nav-close {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--ulm-mobile-text) !important;
    cursor: pointer;
  }
  html body .ulm-mobile-nav-close svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
  }
  html body .ulm-mobile-nav-content {
    width: min(var(--ulm-mobile-grid-width), calc(100% - 2 * var(--ulm-mobile-grid-gutter)));
    margin: 0 auto;
    padding: 12px 0 36px;
  }
  html body .ulm-mobile-nav-view[hidden] { display: none !important; }
  html body .ulm-mobile-nav-view:not([hidden]) { animation: ulm-mobile-nav-view-enter .2s ease both; }
  html body .ulm-mobile-nav-list { display: block; }
  html body .ulm-mobile-nav-row,
  html body .ulm-mobile-nav-sub-link,
  html body .ulm-mobile-nav-card,
  html body .ulm-mobile-nav-project {
    display: flex !important;
    align-items: center;
    width: 100%;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--ulm-mobile-text) !important;
    font-family: inherit;
    text-align: left;
    text-decoration: none !important;
    cursor: pointer;
  }
  html body .ulm-mobile-nav-row {
    min-height: 58px;
    padding: 14px 0 !important;
    border-bottom: 1px solid var(--ulm-mobile-border) !important;
    font-size: 18px;
    line-height: 1.35;
    font-weight: 500;
  }
  html body .ulm-mobile-nav-row > span:first-child,
  html body .ulm-mobile-nav-row > .ulm-mobile-nav-row-label,
  html body .ulm-mobile-nav-sub-link > span:first-child { flex: 1; min-width: 0; }
  html body .ulm-mobile-nav-category-icon {
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    margin-right: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  html body .ulm-mobile-nav-row--secondary {
    min-height: 51px;
    padding: 12px 0 !important;
    font-size: 15px;
    font-weight: 600;
  }
  html body .ulm-mobile-nav-row:hover,
  html body .ulm-mobile-nav-card:hover,
  html body .ulm-mobile-nav-project:hover,
  html body .ulm-mobile-nav-sub-link:hover { color: var(--ulm-mobile-accent) !important; }
  html body .ulm-mobile-nav-icon {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    margin-left: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  html body .ulm-mobile-nav-mega { padding: 4px 0 12px; }
  html body .ulm-mobile-nav-items,
  html body .ulm-mobile-nav-projects { padding: 4px 0 12px; }
  html body .ulm-mobile-nav-sub-link {
    min-height: 42px;
    padding: 8px 0 !important;
    color: var(--ulm-mobile-accent) !important;
    font-size: 14px;
    line-height: 1.4;
    font-weight: 600;
  }
  html body .ulm-mobile-nav-card {
    gap: 12px;
    min-height: 62px;
    padding: 10px 0 !important;
  }
  html body .ulm-mobile-nav-card-copy { flex: 1; min-width: 0; }
  html body .ulm-mobile-nav-card-title {
    display: block;
    flex: 1;
    color: inherit;
    font-size: 15px;
    line-height: 1.35;
    font-weight: 600;
  }
  html body .ulm-mobile-nav-card-description {
    display: block;
    margin-top: 3px;
    color: var(--ulm-mobile-muted);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
  }
  html body .ulm-mobile-nav-logo {
    display: flex;
    flex: 0 0 60px;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 34px;
    overflow: hidden;
    padding: 3px 5px;
    border-radius: 17px;
    background: var(--ulm-mobile-logo-bg);
  }
  html body .ulm-mobile-nav-logo img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: 100%;
    object-fit: contain;
  }
  html body .ulm-mobile-nav-logo img[src$="/expo-wordmark.svg"],
  html body .ulm-mobile-nav-logo img[src$="/pwa.svg"],
  html body .ulm-mobile-nav-logo img[src$="/figma.svg"],
  html body .ulm-mobile-nav-logo img[src*="/claude-official-"],
  html body .ulm-mobile-nav-logo img[src*="/openai-official-"],
  html body .ulm-mobile-nav-logo img[src*="/replit-official-"] {
    transform: scale(.82);
  }
  html body .ulm-mobile-nav-logo--traffic { filter: brightness(0); }
  html body .ulm-mobile-nav-card-icon {
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
  }
  html body .ulm-mobile-nav-project {
    gap: 12px;
    min-height: 58px;
    padding: 6px 0 !important;
    font-size: 14px;
    font-weight: 500;
  }
  html body .ulm-mobile-nav-project > span { flex: 1; min-width: 0; }
  html body .ulm-mobile-nav-project img {
    flex: 0 0 56px;
    width: 56px;
    height: 42px;
    object-fit: cover;
    border-radius: 6px;
  }
  html body .ulm-mobile-nav-ceo {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: auto;
    min-height: 44px;
    margin: 20px 0 0 !important;
    padding: 0 20px !important;
    border: 1px solid #0068ff !important;
    border-radius: 999px !important;
    background: #0068ff !important;
    color: #fff !important;
    box-shadow: none !important;
    font: inherit;
    font-size: 16px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
  }
  html body .ulm-mobile-nav-ceo .ulm-mobile-nav-icon {
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    margin-left: 0;
  }
  html body .ulm-mobile-nav-ceo:hover {
    background: #fff !important;
    color: #0068ff !important;
  }
  html body .ulm-mobile-nav :is(a, button):focus-visible {
    outline: 2px solid #0068ff !important;
    outline-offset: 3px;
  }
  @keyframes ulm-mobile-nav-enter {
    from { opacity: 0; }
    to { opacity: 1; }
  }
  @keyframes ulm-tablet-nav-enter {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
  }
  @keyframes ulm-mobile-nav-view-enter {
    from { opacity: 0; transform: translateX(12px); }
    to { opacity: 1; transform: translateX(0); }
  }
}
@media (min-width: 768px) and (max-width: 1320px) and (min-height: 500px) {
  html body .ulm-mobile-nav {
    background: rgba(7, 1, 20, .58);
  }
  html body .ulm-mobile-nav-scroll {
    width: min(420px, 100%);
    margin-left: auto;
    background: var(--ulm-mobile-bg);
    box-shadow: -12px 0 40px rgba(0, 0, 0, .18);
    animation: ulm-tablet-nav-enter .25s ease both;
  }
  html body .ulm-mobile-nav-brand { display: none; }
}
@media (min-width: 1025px) and (max-width: 1320px) {
  html body .ulm-mobile-nav-brand { width: 260px; }
}
@media (max-width: 1024px) {
  /* Preserve the existing logo and burger dimensions while removing only
     the offset before the logo and after the burger. */
  html body #mfn-header-template .mcb-column-inner-gdqjzsdvm,
  html body #mfn-header-template .mcb-column-inner-fbt8bu5i {
    margin-left: 0 !important;
    margin-right: 10px !important;
  }
  html body #mfn-header-template .mcb-column-inner-fbt8bu5i {
    margin-left: 10px !important;
    margin-right: 0 !important;
  }
}
@media (max-width: 767px) {
  body { --ulm-mobile-grid-gutter: var(--ulm-content-gutter, 16px); }
  html body .ulm-mobile-nav-header {
    min-height: calc(64px + env(safe-area-inset-top));
    padding-top: calc(10px + env(safe-area-inset-top));
    padding-bottom: 9px;
  }
}
@media (max-width: 1320px) and (prefers-reduced-motion: reduce) {
  html body .ulm-mobile-nav,
  html body .ulm-mobile-nav-scroll,
  html body .ulm-mobile-nav-view:not([hidden]) { animation: none; }
}
