/* ─────────────────────────────────────────────────────────
   Hero section-label standardization — industry-ai-startups spec
   Applies all viewports. Excludes industry pages (ais/bbs/ec/edt/
   ft/ht/hrt/lg/lgt/ind) and light-bg heroes (startup/sol/agency).
   ───────────────────────────────────────────────────────── */
section[class*="-hero"]:not(.startup-hero):not(.sol-hero):not(.agency-hero):not(.ais-hero):not(.bbs-hero):not(.ec-hero):not(.edt-hero):not(.ft-hero):not(.ht-hero):not(.hrt-hero):not(.lg-hero):not(.lgt-hero):not(.ind-hero) .section-label{
  display: flex !important;
  width: fit-content !important;
  align-items: center !important;
  gap: 0.625rem !important;
  font-family: var(--font-mono) !important;
  font-size: 0.68rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.13em !important;
  text-transform: uppercase !important;
  color: var(--teal-bright) !important;
  background: rgba(60,234,199,0.1) !important;
  border: 1px solid rgba(60,234,199,0.2) !important;
  border-radius: 100px !important;
  padding: 5px 14px !important;
  margin: 0 0 1.5rem !important;
}

/* Heading directly after standardized hero label — match AIS h1 margin-top */
section[class*="-hero"]:not(.startup-hero):not(.sol-hero):not(.agency-hero):not(.ais-hero):not(.bbs-hero):not(.ec-hero):not(.edt-hero):not(.ft-hero):not(.ht-hero):not(.hrt-hero):not(.lg-hero):not(.lgt-hero):not(.ind-hero) .section-label + h1,
section[class*="-hero"]:not(.startup-hero):not(.sol-hero):not(.agency-hero):not(.ais-hero):not(.bbs-hero):not(.ec-hero):not(.edt-hero):not(.ft-hero):not(.ht-hero):not(.hrt-hero):not(.lg-hero):not(.lgt-hero):not(.ind-hero) h1{
  margin-top: 0.85rem !important;
}

/* Mobile hero — uniform 1rem/1rem, start directly below fixed nav, no overlap, no gap */
@media (max-width: 768px){
  body{
    padding-top: var(--nav-h, 72px) !important;
  }
  /* Hide breadcrumb strips that sit ABOVE hero on mobile */
  .vs-breadcrumb,
  .page-breadcrumb{
    display: none !important;
  }
  section[class*="-hero"],
  section.hero{
    min-height: auto !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
  }
  section[class*="-hero"] > .container,
  section.hero > .container,
  /* Pages that wrap hero with non-.container inners */
  section.arc-hero > .arc-inner,
  section.mob-hero > .mob-inner,
  section.mvp-hero > .mvp-inner,
  section.ux-hero > .ux-inner,
  section.saas-hero > .saas-hero-inner,
  section.hero > .hero-grid,
  section.startup-hero > .hero-grid,
  section.blog-hero > .blog-hero-inner{
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
  }
}

/* ─────────────────────────────────────────────────────────
   iOS mobile fixes: prevent input zoom, kill horizontal
   whitespace below footer, polish form error messages.
   ───────────────────────────────────────────────────────── */

/* Body/html: stop horizontal overflow gap (esp. iOS Safari) */
html, body{
  overflow-x: clip !important;
  max-width: 100% !important;
}
body{
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  margin: 0 !important;
  padding-bottom: 0 !important;
}
/* Kill iOS bottom whitespace + block overscroll past footer.
   1. html bg matches footer so any micro-overscroll blends.
   2. overscroll-behavior-y: none stops iOS rubber-band beyond footer.
   3. Body and footer terminate cleanly with zero trailing margin. */
html{
  background: var(--dark) !important;
  overscroll-behavior-y: none !important;
  -webkit-overflow-scrolling: auto !important;
}
body{
  overscroll-behavior-y: none !important;
  margin: 0 !important;
  padding-bottom: 0 !important;
}
html, body{ min-height: 0 !important; }
main{ margin-bottom: 0 !important; }
main > *:last-child{ margin-bottom: 0 !important; }
footer{
  margin-bottom: 0 !important;
  padding-bottom: env(safe-area-inset-bottom, 0) !important;
}
footer > *:last-child,
.footer-bottom{ margin-bottom: 0 !important; padding-bottom: 1rem !important; }

/* ──────────────────────────────────────────────
   iOS-Safari-only footer interior fix.
   `@supports (-webkit-touch-callout: none)` matches iOS Safari only.
   Aggressively flattens any whitespace iOS renders inside the footer. */
@supports (-webkit-touch-callout: none){
  /* Force dark bg on the entire bottom of the page so no cream / white
     surface can show through on iOS, regardless of element. */
  html,
  body,
  main + footer,
  footer{
    background-color: #001A15 !important;
  }
  footer{
    padding: 1.75rem 1.25rem calc(1rem + env(safe-area-inset-bottom, 0)) !important;
    margin: 0 !important;
    display: block !important;
    border: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }
  footer *,
  footer *::before,
  footer *::after{
    background-color: transparent !important;
  }
  footer .footer-inner{
    padding: 0 0 1.25rem !important;
    margin: 0 !important;
    gap: 1.5rem !important;
    border-bottom: 1px solid rgba(255,255,255,0.08) !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  footer .footer-bottom{
    padding: 0.75rem 0 0 !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  footer > *:first-child{ margin-top: 0 !important; padding-top: 0 !important; }
  footer > *:last-child{ margin-bottom: 0 !important; }
  footer .footer-brand,
  footer .footer-meta,
  footer .footer-cat-list,
  footer .footer-cat-list li,
  footer .footer-cat-group,
  footer .footer-brand-connect{
    margin-bottom: 0 !important;
  }
  /* Kill the slack-pop sibling completely on iOS when hidden so it
     cannot reserve any layout space. */
  body > .slack-pop[hidden]{ display: none !important; }
}

/* Footer: no horizontal whitespace beyond viewport */
footer{
  width: 100% !important;
  max-width: 100vw !important;
  overflow-x: clip !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}
footer .footer-inner,
footer .footer-bottom{
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* iOS prevents form zoom only when input/textarea/select font-size >= 16px */
@media (max-width: 768px){
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="url"],
  input[type="search"],
  input[type="number"],
  input[type="password"],
  input[type="date"],
  input[type="datetime-local"],
  input[type="month"],
  input[type="time"],
  input[type="week"],
  input:not([type]),
  textarea,
  select{
    font-size: 16px !important;
    -webkit-text-size-adjust: 100%;
    -webkit-appearance: none;
    appearance: none;
    border-radius: inherit;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  /* Prevent iOS auto-zoom on focus */
  input:focus,
  textarea:focus,
  select:focus{
    font-size: 16px !important;
  }
}

/* Form error messages — visible, accessible, no layout jump */
.contact-error,
.form-error,
.field-error{
  color: #dc2626 !important;
  font-size: 0.85rem !important;
  font-weight: 500 !important;
  line-height: 1.5 !important;
  margin-top: 0.5rem !important;
  padding: 0.4rem 0.75rem !important;
  background: rgba(220,38,38,0.06) !important;
  border-left: 3px solid #dc2626 !important;
  border-radius: 0 6px 6px 0 !important;
  display: none;
}
.contact-error:not(:empty),
.contact-error.show,
.form-error:not(:empty),
.form-error.show,
.field-error:not(:empty),
.field-error.show{
  display: block !important;
  animation: empErrShow 0.18s ease-out;
}
@keyframes empErrShow{
  from{ opacity: 0; transform: translateY(-2px); }
  to{ opacity: 1; transform: translateY(0); }
}
.contact-error::before,
.form-error::before,
.field-error::before{
  content: "⚠ ";
  font-weight: 700;
  margin-right: 0.25rem;
}

/* Input invalid state — clearer red border on iOS */
.ctsf-input:invalid:not(:placeholder-shown),
.contact-textarea:invalid:not(:placeholder-shown),
input.is-invalid,
textarea.is-invalid,
select.is-invalid{
  border-color: #dc2626 !important;
  box-shadow: 0 0 0 3px rgba(220,38,38,0.08) !important;
}

/* ─────────────────────────────────────────────────────────
   iOS work-page image loading fix
   - aspect-ratio fallback for older Safari
   - guaranteed min-height so layout never collapses
   - reveal animations never hide the image area itself
   ───────────────────────────────────────────────────────── */
.work-card-visual{
  position: relative !important;
  width: 100% !important;
  background: var(--dark);
  overflow: hidden;
}
@supports not (aspect-ratio: 16 / 9){
  .work-card-visual{
    height: 0 !important;
    padding-bottom: 56.25% !important;
  }
  .work-card-img{
    position: absolute !important;
    inset: 0 !important;
  }
}
.work-card-img{
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center !important;
  display: block !important;
  opacity: 1 !important;
  transform: none !important;
}
/* reveal animation should never hide the image itself on iOS */
.work-card.reveal .work-card-img,
.reveal .work-card-img{
  opacity: 1 !important;
}

@media (max-width: 768px){
  .work-card-visual{
    aspect-ratio: 16 / 9;
    min-height: 200px;
  }
}

/* ─────────────────────────────────────────────────────────
   iOS-ONLY mobile footer whitespace kill (≤768px).
   Eliminates any gap inside or below <footer> on iOS Safari/
   Chrome/etc. Targets all HTML pages via shared stylesheet.
   `@supports (-webkit-touch-callout: none)` matches iOS only.
   ───────────────────────────────────────────────────────── */
/* ─────────────────────────────────────────────────────────
   Mobile slider menu close (✕) — kill double-ring focus.
   Border + focus outline rendered as 2 concentric circles
   around the X. Drop outline + box-shadow on focus.
   ───────────────────────────────────────────────────────── */
@media (max-width: 768px){
  .mobile-menu .close-btn,
  .mobile-menu .close-btn:focus,
  .mobile-menu .close-btn:focus-visible,
  .mobile-menu .close-btn:active{
    outline: none !important;
    box-shadow: none !important;
  }
  .mobile-menu .close-btn:focus-visible{
    background: rgba(255,255,255,0.18) !important;
    border-color: rgba(60,234,199,0.5) !important;
  }
}

@supports (-webkit-touch-callout: none){
  @media (max-width: 768px){
    html,
    body{
      background-color: #001A15 !important;
      background-image: none !important;
      min-height: 100% !important;
      margin: 0 !important;
      padding-bottom: 0 !important;
      overscroll-behavior-y: none !important;
    }
    body{
      min-height: 100dvh !important;
    }
    /* Footer: zero trailing space inside and after */
    footer{
      background-color: #001A15 !important;
      margin: 0 !important;
      padding-bottom: 1rem !important;
      border-bottom: 0 !important;
    }
    footer::after,
    footer::before{
      display: none !important;
      content: none !important;
    }
    footer > *:last-child,
    footer .footer-bottom{
      margin-bottom: 0 !important;
      padding-bottom: 0 !important;
    }
    /* Hidden popups/modals after <footer> must not reserve space */
    body > [hidden]{
      display: none !important;
    }
    /* Body's last child terminates flush */
    body > *:last-child{
      margin-bottom: 0 !important;
    }
  }
}

/* ─────────────────────────────────────────────────────────
   ux-ui page: +23% lift number in proof section on mobile.
   Sits between 4.2% (before) and 5.1% (after) stacked cols.
   Match scale of column numbers, center cleanly in divider strip.
   ───────────────────────────────────────────────────────── */
@media (max-width: 768px){
  .ux-proof-divider{
    padding: 2rem 2.5rem !important;
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: center !important;
    text-align: left !important;
    gap: 0 !important;
    box-sizing: border-box !important;
  }
  .ux-proof-lift{
    font-size: clamp(2.8rem, 12vw, 3.6rem) !important;
    line-height: 1 !important;
    display: block !important;
    width: 100% !important;
    text-align: left !important;
    letter-spacing: -0.025em !important;
    margin: 0 !important;
    padding: 0 !important;
    white-space: nowrap !important;
  }
}

/* ─────────────────────────────────────────────────────────
   Mobile tap-highlight fix: kill translucent blue flash that
   iOS/Android paint on tap via -webkit-tap-highlight-color.
   Mobile only. No other state changes.
   ───────────────────────────────────────────────────────── */
@media (max-width: 768px){
  a,
  button,
  .btn,
  input[type="button"],
  input[type="submit"],
  input[type="reset"],
  [role="button"],
  [onclick],
  label,
  summary{
    -webkit-tap-highlight-color: transparent !important;
    tap-highlight-color: transparent !important;
  }
}

/* ─────────────────────────────────────────────────────────
   Mobile slide-out menu: stop closed-state sliver on right.
   Force fully off-canvas + zero opacity + hidden visibility.
   ───────────────────────────────────────────────────────── */
@media (max-width: 768px){
  .mobile-menu:not(.open){
    transform: translate3d(110%, 0, 0) !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    box-shadow: none !important;
  }
  .mobile-menu.open{
    transform: translate3d(0, 0, 0) !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
  html:not(:has(.mobile-menu.open)) .mobile-menu{
    transform: translate3d(110%, 0, 0) !important;
  }
}

/* ─────────────────────────────────────────────────────────
   About page: stop horizontal overflow / content cut-off.
   Every about-* section + descendant constrained to viewport.
   ───────────────────────────────────────────────────────── */
@media (max-width: 768px){
  body:has(.about-hero),
  body:has(.about-hero) main,
  body:has(.about-hero) main > *{
    overflow-x: clip !important;
    max-width: 100vw !important;
  }
  section.about-hero,
  section.about-philosophy,
  section.about-work,
  section.about-values,
  section.about-sprint,
  section.about-connect,
  section.about-newsletter{
    overflow-x: clip !important;
    max-width: 100vw !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  section.about-hero .container,
  section.about-philosophy .container,
  section.about-work .container,
  section.about-values .container,
  section.about-sprint .container,
  section.about-connect .container,
  section.about-newsletter .container{
    max-width: 100% !important;
    width: 100% !important;
    padding-left: 1.25rem !important;
    padding-right: 1.25rem !important;
    box-sizing: border-box !important;
  }
  section.about-hero *,
  section.about-philosophy *,
  section.about-work *,
  section.about-values *,
  section.about-sprint *,
  section.about-connect *,
  section.about-newsletter *{
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  section.about-hero img,
  section.about-hero svg,
  section.about-hero picture,
  section.about-philosophy img,
  section.about-work img,
  section.about-values img,
  section.about-values svg,
  section.about-connect img{
    max-width: 100% !important;
    height: auto;
  }
  .about-hero h1,
  .about-hero .about-hero-tenure,
  .about-hero .about-hero-body{
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
    hyphens: auto;
  }
  .about-hero-stats{
    flex-wrap: wrap !important;
    gap: 1rem !important;
  }
  .about-hero-stat{
    flex: 1 1 calc(50% - 0.5rem) !important;
    min-width: 0 !important;
  }
  /* Sprint table stays as overflowing block on small screens */
  .about-sprint-table{
    width: 100% !important;
    table-layout: fixed !important;
  }
}
