/* AVIX Water responsive system v65 — authoritative final cascade layer.
   Purpose: repair phone/tablet hero collapse, 1024 navigation crowding,
   large-screen hero clipping, and responsive card/data overflow. */

:root{
  --avix-v65-max:1280px;
  --avix-v65-gutter:clamp(18px,3.125vw,48px);
}
html,body{max-width:100%;overflow-x:clip}
*,*::before,*::after{box-sizing:border-box}
img,svg,video,picture,canvas{max-width:100%;height:auto}

/* One content edge for header and public content. */
.av5-header .av5-header-inner{
  width:min(var(--avix-v65-max),calc(100% - (2 * var(--avix-v65-gutter))))!important;
  max-width:var(--avix-v65-max)!important;
  margin-inline:auto!important;
}

/* 1024-class devices should use the drawer, not a squeezed desktop nav. */
@media(max-width:1080px){
  .av5-header-inner{min-height:70px!important}
  .av5-brand img{width:168px!important}
  .av5-menu{display:block!important;position:relative!important;z-index:160!important}
  .av5-nav{
    position:fixed!important;
    inset:0 0 auto 0!important;
    z-index:150!important;
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:0!important;
    width:100%!important;
    max-width:none!important;
    max-height:100dvh!important;
    padding:calc(var(--avix-announcement-h,34px) + 88px) max(24px,var(--avix-safe-right,0px)) max(30px,var(--avix-safe-bottom,0px)) max(24px,var(--avix-safe-left,0px))!important;
    overflow-y:auto!important;
    background:#091215!important;
    transform:translateY(-110%)!important;
    transition:transform .28s ease!important;
    box-shadow:0 30px 60px rgba(0,0,0,.3)!important;
  }
  .av5-nav.is-open{transform:none!important}
  .av5-nav>a:not(.av5-button),
  .av5-nav>a.av5-nav-contact{
    display:flex!important;
    align-items:center!important;
    justify-content:flex-start!important;
    width:100%!important;
    min-height:52px!important;
    padding:14px 0!important;
    border-bottom:1px solid rgba(255,255,255,.12)!important;
    border-radius:0!important;
    background:transparent!important;
    color:#e6ecee!important;
    font-size:17px!important;
    line-height:1.25!important;
  }
  .av5-nav>a::after{display:none!important}
}


/* Tablet card density: 1024-class devices need two readable columns, not desktop four-up cards. */
@media(max-width:1080px){
  :is(
    .av5-evidence-grid,.sr-standard-grid,.av5-products-grid,.sr-readiness-track,
    .sr-protect-grid,.sr-product-grid,.inv5-packaging-grid,.sr-value-grid,
    .co18-proof-grid,.co18-build-grid,.co18-market-grid,.co18-partner-grid,
    .team9-team-grid,.team9-build-grid,.fp-proof-grid,.fp2-water-grid,.fp-venture-grid
  ){grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:18px!important}
}

/* --------------------------------------------------------------------------
   Principal heroes: kill the legacy 360px minimum second column on tablets.
   These selectors intentionally outrank the page-specific v29 desktop rules.
   -------------------------------------------------------------------------- */
@media(max-width:860px){
  .home-v8.science-v12 .s12-hero.avix-principal-hero,
  .home-v8.products-v3 .p3-hero.avix-principal-hero,
  .home-v8.co18-page .co18-hero.avix-principal-hero,
  .home-v8.tc-team-page .tc-hero.avix-principal-hero,
  .home-v8.fp-page .fp-hero.avix-principal-hero,
  .home-v8.tc-contact-page .tc-hero.avix-principal-hero{
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    padding-top:var(--avix-main-chrome,104px)!important;
    overflow:hidden!important;
  }

  .home-v8.science-v12 .s12-hero.avix-principal-hero .s12-hero-grid,
  .home-v8.products-v3 .p3-hero.avix-principal-hero .p3-hero-grid,
  .home-v8.co18-page .co18-hero.avix-principal-hero .co18-hero-grid,
  .home-v8.tc-team-page .tc-hero.avix-principal-hero .tc-hero-grid,
  .home-v8.fp-page .fp-hero.avix-principal-hero .fp-hero-grid,
  .home-v8.tc-contact-page .tc-hero.avix-principal-hero .tc-hero-grid{
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
    width:min(var(--avix-v65-max),calc(100% - 36px))!important;
    max-width:var(--avix-v65-max)!important;
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    gap:0!important;
    margin-inline:auto!important;
    padding:0!important;
    align-items:start!important;
  }

  .home-v8.science-v12 .s12-hero-copy,
  .home-v8.products-v3 .p3-hero-copy,
  .home-v8.co18-page .co18-hero-copy,
  .home-v8.tc-team-page .tc-hero-copy,
  .home-v8.fp-page .fp-hero-copy,
  .home-v8.tc-contact-page .tc-hero-copy{
    width:100%!important;
    min-width:0!important;
    max-width:720px!important;
    padding:clamp(42px,7vw,58px) 0 18px!important;
    margin:0!important;
  }

  .home-v8.avix-principal-page .avix-principal-hero h1{
    width:100%!important;
    max-width:720px!important;
    margin:0!important;
    font-size:clamp(46px,7.2vw,56px)!important;
    line-height:.98!important;
    letter-spacing:-.045em!important;
    overflow-wrap:normal!important;
    word-break:normal!important;
    hyphens:none!important;
  }
  .home-v8.avix-principal-page .avix-principal-hero h1>span{
    display:block!important;
    width:auto!important;
    white-space:normal!important;
  }
  /* Legacy Science rules used a more-specific nowrap!important on the teal final line. */
  .home-v8.science-v12 .s12-hero.avix-principal-hero h1>span,
  .home-v8.science-v12 .s12-hero.avix-principal-hero h1>span:last-child{
    display:block!important;
    width:auto!important;
    white-space:normal!important;
  }
  .home-v8.avix-principal-page .avix-principal-hero .hero-lines-3,
  .home-v8.avix-principal-page .avix-principal-hero .s12-hero-copy>p:not(.av5-eyebrow),
  .home-v8.avix-principal-page .avix-principal-hero .p3-hero-copy>p:not(.av5-eyebrow),
  .home-v8.avix-principal-page .avix-principal-hero .co18-hero-copy>p:not(.av5-eyebrow),
  .home-v8.avix-principal-page .avix-principal-hero .tc-hero-copy>p:not(.av5-eyebrow),
  .home-v8.avix-principal-page .avix-principal-hero .fp-hero-copy>p:not(.av5-eyebrow){
    display:block!important;
    width:100%!important;
    max-width:680px!important;
    margin-top:20px!important;
    font-size:17px!important;
    line-height:1.56!important;
    overflow-wrap:break-word!important;
    word-break:normal!important;
  }
  .home-v8.avix-principal-page .avix-principal-hero .hero-lines-3>span{display:inline!important;white-space:normal!important}
  .home-v8.avix-principal-page .avix-principal-hero .av5-actions{
    display:flex!important;
    flex-wrap:wrap!important;
    width:100%!important;
    margin-top:22px!important;
    gap:12px!important;
  }

  /* All principal visuals become normal-flow responsive blocks. */
  .home-v8.science-v12 .s12-hero.avix-principal-hero .s12-hero-visual,
  .home-v8.products-v3 .p3-hero.avix-principal-hero .p3-hero-products,
  .home-v8.co18-page .co18-hero.avix-principal-hero .co18-hero-visual,
  .home-v8.tc-team-page .tc-hero.avix-principal-hero .team9-hero-art,
  .home-v8.fp-page .fp-hero.avix-principal-hero .fp-hero-visual,
  .home-v8.tc-contact-page .tc-hero.avix-principal-hero .avix-utility-visual{
    grid-column:1!important;
    width:min(100%,580px)!important;
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    margin:8px auto 38px!important;
    padding:0!important;
    transform:none!important;
    align-self:auto!important;
    justify-self:center!important;
    overflow:visible!important;
  }
  .home-v8.science-v12 .s12-hero-visual img,
  .home-v8.science-v12 .s12-hero-visual .s12-science-system-svg{width:min(100%,500px)!important;max-width:500px!important;max-height:390px!important;object-fit:contain!important}
  .home-v8.products-v3 .p3-hero-products img{width:min(100%,540px)!important;max-width:540px!important;max-height:390px!important;object-fit:contain!important}
  .home-v8.co18-page .co18-investment-bridge{width:min(100%,540px)!important;max-width:540px!important;transform:none!important}
  .home-v8.tc-team-page .team9-hero-art img{width:min(100%,460px)!important;max-width:460px!important;max-height:380px!important;object-fit:contain!important}
  .home-v8.fp-page .fp-science-map{width:min(100%,520px)!important;max-width:520px!important}
  .home-v8.tc-contact-page .avix-utility-visual img{width:100%!important;height:auto!important;max-height:360px!important;object-fit:contain!important}
}

@media(max-width:620px){
  :root{--avix-v65-gutter:14px}
  .av5-header .av5-header-inner{width:calc(100% - 28px)!important}

  .home-v8.science-v12 .s12-hero.avix-principal-hero .s12-hero-grid,
  .home-v8.products-v3 .p3-hero.avix-principal-hero .p3-hero-grid,
  .home-v8.co18-page .co18-hero.avix-principal-hero .co18-hero-grid,
  .home-v8.tc-team-page .tc-hero.avix-principal-hero .tc-hero-grid,
  .home-v8.fp-page .fp-hero.avix-principal-hero .fp-hero-grid,
  .home-v8.tc-contact-page .tc-hero.avix-principal-hero .tc-hero-grid{
    width:calc(100% - 28px)!important;
  }
  .home-v8.avix-principal-page .avix-principal-hero h1{
    font-size:clamp(38px,11.2vw,46px)!important;
    line-height:.98!important;
    letter-spacing:-.04em!important;
  }
  .home-v8.avix-principal-page .avix-principal-hero .av5-eyebrow{font-size:10.5px!important;line-height:1.35!important;white-space:normal!important}
  .home-v8.avix-principal-page .avix-principal-hero .hero-lines-3,
  .home-v8.avix-principal-page .avix-principal-hero .s12-hero-copy>p:not(.av5-eyebrow),
  .home-v8.avix-principal-page .avix-principal-hero .p3-hero-copy>p:not(.av5-eyebrow),
  .home-v8.avix-principal-page .avix-principal-hero .co18-hero-copy>p:not(.av5-eyebrow),
  .home-v8.avix-principal-page .avix-principal-hero .tc-hero-copy>p:not(.av5-eyebrow),
  .home-v8.avix-principal-page .avix-principal-hero .fp-hero-copy>p:not(.av5-eyebrow){font-size:16px!important;line-height:1.56!important}
  .home-v8.avix-principal-page .avix-principal-hero .av5-actions{display:grid!important;grid-template-columns:1fr!important}
  .home-v8.avix-principal-page .avix-principal-hero .av5-button{width:100%!important;justify-content:center!important}

  .home-v8.science-v12 .s12-hero-visual img,
  .home-v8.science-v12 .s12-hero-visual .s12-science-system-svg{max-height:310px!important}
  .home-v8.products-v3 .p3-hero-products img{max-height:300px!important}
  .home-v8.co18-page .co18-investment-bridge{max-width:350px!important}
  .home-v8.tc-team-page .team9-hero-art img{max-height:310px!important}
  .home-v8.tc-contact-page .avix-utility-visual img{max-height:280px!important}
}

/* Homepage: safe scaling on very large screens and a more compact tablet hero. */
@media(min-width:1680px){
  .home-v8.avix-home-page .av5-hero.avix-home-hero h1{
    font-size:84px!important;
    line-height:.92!important;
    row-gap:.075em!important;
  }
  .home-v8.avix-home-page .av5-hero.avix-home-hero .av5-hero-lead{
    max-width:720px!important;
    margin-top:20px!important;
    font-size:18px!important;
    line-height:1.5!important;
  }
  .home-v8.avix-home-page .av5-hero.avix-home-hero .av5-actions{margin-top:18px!important}
}
@media(min-width:861px) and (max-width:1180px){
  .home-v8.avix-home-page .av5-hero.avix-home-hero h1{font-size:clamp(58px,6vw,68px)!important;line-height:.93!important}
  .home-v8.avix-home-page .av5-hero.avix-home-hero .av5-hero-lead{font-size:16.5px!important;line-height:1.52!important;margin-top:20px!important}
}
@media(max-width:860px){
  .home-v8.avix-home-page .av5-hero.avix-home-hero h1{font-size:clamp(48px,8vw,60px)!important;line-height:.95!important}
  .home-v8.avix-home-page .av5-hero.avix-home-hero .av5-hero-copy{padding-top:clamp(44px,7vw,58px)!important}
  .home-v8.avix-home-page .av5-hero.avix-home-hero .av5-hero-bottle img{width:min(38vw,220px)!important;max-width:220px!important}
  .home-v8.avix-home-page .av5-hero.avix-home-hero .sr-hero-proof-grid article{min-height:98px!important;padding:17px 18px!important}
}
@media(max-width:620px){
  .home-v8.avix-home-page .av5-hero.avix-home-hero h1{font-size:clamp(40px,12vw,48px)!important}
  .home-v8.avix-home-page .av5-hero.avix-home-hero .av5-hero-bottle img{width:min(48vw,190px)!important;max-width:190px!important}
  .home-v8.avix-home-page .av5-hero.avix-home-hero .sr-hero-proof-grid{grid-template-columns:1fr!important}
  .home-v8.avix-home-page .av5-hero.avix-home-hero .sr-hero-proof-grid article{min-height:78px!important}
}

/* Bangladesh evidence: prevent the value/reference cell from escaping tablet cards. */
@media(max-width:900px){
  .home-v8.avix-home-page .av5-bar-row{grid-template-columns:minmax(0,1fr) 96px!important;gap:12px!important}
  .home-v8.avix-home-page .av5-bar-row .av5-bar{grid-column:1/-1!important;grid-row:2!important}
  .home-v8.avix-home-page .av5-bar-row>strong{grid-column:2!important;grid-row:1!important;min-width:0!important;font-size:1.35rem!important}
  .home-v8.avix-home-page .av5-bar-row>strong small{max-width:96px!important;white-space:normal!important;overflow-wrap:break-word!important}
}
@media(max-width:430px){
  .home-v8.avix-home-page .av5-mineral-panel header{display:grid!important;grid-template-columns:1fr!important;gap:10px!important}
  .home-v8.avix-home-page .av5-mineral-panel header strong{text-align:left!important}
  .home-v8.avix-home-page .av5-bar-row{grid-template-columns:minmax(0,1fr) 78px!important;padding-inline:16px!important}
  .home-v8.avix-home-page .av5-bar-row>strong{font-size:1.2rem!important}
}

/* Standard responsive content resilience. */
@media(max-width:860px){
  :is(.av5-section-head,.s12-section-head,.p3-section-head,.co18-heading,.contact-heading-v210){grid-template-columns:1fr!important;gap:22px!important}
  :is(.av5-section-head,.s12-section-head,.p3-section-head,.co18-heading,.contact-heading-v210)>p{max-width:720px!important;padding-top:0!important}
  :is(.av5-section h2,.s12-section-head h2,.p3-section-head h2,.co18-heading h2,.tc-contact-main h2,.fp-page .av5-section h2){font-size:clamp(38px,6.4vw,50px)!important;line-height:1.02!important;letter-spacing:-.04em!important}
}
@media(max-width:620px){
  :is(.av5-section h2,.s12-section-head h2,.p3-section-head h2,.co18-heading h2,.tc-contact-main h2,.fp-page .av5-section h2){font-size:clamp(34px,9.5vw,42px)!important}
  :is(p,li,dd,address,figcaption){word-break:normal!important;overflow-wrap:break-word!important}
}

/* Keep the sticky in-page nav intentionally horizontally scrollable on compact widths. */
@media(max-width:1080px){
  .avix-section-nav__viewport{overflow-x:auto!important;overflow-y:hidden!important}
  .avix-section-nav__inner{width:max-content!important;min-width:100%!important;max-width:none!important}
}


/* Very narrow phones: preserve a readable announcement instead of shrinking all three messages to ~7px. */
@media(max-width:350px){
  .av5-topline,.top-strip,.page-legal .top-strip,.page-references .top-strip{font-size:8.4px!important;letter-spacing:.01em!important}
  .av5-topline .av5-topline-centre span:nth-of-type(2),
  .top-strip .container span:nth-of-type(2),
  .page-legal .top-strip .container span:nth-of-type(2),
  .page-references .top-strip .container span:nth-of-type(2),
  .av5-topline .av5-topline-centre i:first-of-type,
  .top-strip .container i:first-of-type,
  .page-legal .top-strip .container i:first-of-type,
  .page-references .top-strip .container i:first-of-type{display:none!important}
  .av5-topline-centre i,.top-strip .container i,.page-legal .top-strip .container i,.page-references .top-strip .container i{margin-inline:5px!important}
  .av5-topline .av5-topline-centre span:nth-of-type(3),
  .top-strip .container span:nth-of-type(3),
  .page-legal .top-strip .container span:nth-of-type(3),
  .page-references .top-strip .container span:nth-of-type(3){margin-left:10px!important}
}

@media(prefers-reduced-motion:reduce){
  .av5-nav{transition:none!important}
}
