/* DIGIGROUPE V43 — stable nav / measured responsive typography
   Scoped to the existing HOME only. Preserve V37/V40 safe background
   system, V42 planets and agent motion, V9 native carousel transforms.
   No new overlays, videos, page scroll handlers or compositor layers. */

/* The obsolete "work chapter = white header" rule conflicts with the
   dark-blue software gallery. Keep one consistent navy navigation surface
   throughout all chapters, including during scene interpolation. */
body.dg-bg-safe .header,
body.dg-bg-safe.dg-work-chapter .header{
  background:rgba(2,10,28,.96)!important;
  border-bottom:1px solid rgba(163,203,250,.20)!important;
  color:#f5faff!important;
}
body.dg-bg-safe .header .dg-wordmark,
body.dg-bg-safe.dg-work-chapter .header .dg-wordmark,
body.dg-bg-safe .header .navigation a,
body.dg-bg-safe.dg-work-chapter .header .navigation a,
body.dg-bg-safe .header .menu-btn,
body.dg-bg-safe.dg-work-chapter .header .menu-btn{
  color:#eff7ff!important;
}
body.dg-bg-safe .header .navigation .nav-cta,
body.dg-bg-safe.dg-work-chapter .header .navigation .nav-cta{
  background:#1469eb!important;
  border-color:#4b9fff!important;
  color:#fff!important;
}
body.dg-bg-safe .header .menu-btn .hamburger i,
body.dg-bg-safe.dg-work-chapter .header .menu-btn .hamburger i{
  background:#f0f7ff!important;
}
body.dg-bg-safe.dg-work-chapter #dg-meter-chapter{color:#b5d5fc!important}
body.dg-bg-safe.dg-work-chapter .dg-meter-track{background:rgba(166,207,255,.26)!important}
body.dg-bg-safe.dg-work-chapter .dg-meter-track>i{background:#6db6ff!important}
@media(max-width:680px){
  body.dg-bg-safe .header .navigation,
  body.dg-bg-safe.dg-work-chapter .header .navigation{
    background:rgba(2,11,31,.98)!important;
    border-color:rgba(164,208,255,.24)!important;
  }
  body.dg-bg-safe .header .navigation a,
  body.dg-bg-safe.dg-work-chapter .header .navigation a{
    color:#f0f7ff!important;
  }
}

/* Tablet landscape / narrow laptops: two columns should not squeeze a
   huge editorial title into 4+ broken lines next to the carousel.
   This also helps Web / Apps / Method / Contact chapter copy. */
@media(min-width:701px) and (max-width:1000px) and (max-height:899px){
  body.dg-bg-safe .dg-journey.dg-journey-ready .dg-scene-inner{
    grid-template-columns:minmax(0,.92fr) minmax(0,1.08fr)!important;
    gap:clamp(15px,2.4vw,27px)!important;
    width:calc(100% - 44px)!important;
    padding-block:85px 44px!important;
  }
  body.dg-bg-safe .dg-journey.dg-journey-ready .dg-scene-copy h2{
    font-size:clamp(36px,4.65vw,52px)!important;
    line-height:1.045!important;
    letter-spacing:-.057em!important;
    margin-block:13px 17px!important;
  }
  body.dg-bg-safe .dg-journey.dg-journey-ready .dg-scene-copy>p{
    font-size:clamp(13px,1.53vw,16px)!important;
    line-height:1.5!important;
    max-width:44ch!important;
  }
  body.dg-bg-safe .dg-journey.dg-journey-ready .dg-scene-link{
    margin-top:18px!important;
  }
  body.dg-bg-safe .dg-journey.dg-journey-ready .dg-scene-interface{
    min-width:0!important;
    max-width:100%!important;
  }
}

/* Portrait tablets: stack copy above the interactive 3D stage instead of
   using a narrow newspaper-style column and 4-6 line headings.
   No transforms; original carousel camera and link click areas remain. */
@media(min-width:701px) and (max-width:1000px) and (min-height:900px){
  body.dg-bg-safe .dg-journey.dg-journey-ready .dg-scene:is(
    [data-stage="ai"],[data-stage="work"],[data-stage="web"],
    [data-stage="apps"],[data-stage="method"],[data-stage="contact"]
  ) .dg-scene-inner{
    display:flex!important;
    flex-direction:column!important;
    justify-content:center!important;
    align-items:stretch!important;
    gap:clamp(12px,1.75svh,22px)!important;
    width:calc(100% - 66px)!important;
    height:100%!important;
    min-height:0!important;
    padding:90px 0 48px!important;
  }
  body.dg-bg-safe .dg-journey.dg-journey-ready .dg-scene:is(
    [data-stage="ai"],[data-stage="work"],[data-stage="web"],
    [data-stage="apps"],[data-stage="method"],[data-stage="contact"]
  ) .dg-scene-copy{
    width:100%!important;
    max-width:780px!important;
    flex:0 0 auto!important;
  }
  body.dg-bg-safe .dg-journey.dg-journey-ready .dg-scene:is(
    [data-stage="ai"],[data-stage="work"],[data-stage="web"],
    [data-stage="apps"],[data-stage="method"],[data-stage="contact"]
  ) .dg-scene-copy h2{
    font-size:clamp(42px,5.6vw,58px)!important;
    letter-spacing:-.061em!important;
    line-height:1.025!important;
    margin:12px 0 14px!important;
    max-width:14ch!important;
  }
  body.dg-bg-safe .dg-journey.dg-journey-ready .dg-scene-copy>p{
    font-size:clamp(14px,1.75vw,17px)!important;
    line-height:1.48!important;
    max-width:52ch!important;
  }
  body.dg-bg-safe .dg-journey.dg-journey-ready .dg-scene-link{
    margin-top:12px!important;
  }
  body.dg-bg-safe .dg-journey.dg-journey-ready .dg-scene:is(
    [data-stage="ai"],[data-stage="work"],[data-stage="web"],
    [data-stage="apps"],[data-stage="method"],[data-stage="contact"]
  ) .dg-scene-interface{
    flex:0 1 auto!important;
    width:100%!important;
    max-width:100%!important;
    margin-top:2px!important;
    min-height:0!important;
  }
  body.dg-bg-safe .dg-journey.dg-journey-ready .dg-scene[data-stage="ai"] .dg-agents-grid{
    height:clamp(260px,32svh,345px)!important;
  }
  body.dg-bg-safe .dg-journey.dg-journey-ready .dg-scene[data-stage="work"] .dg-software-collection{
    height:clamp(225px,27svh,325px)!important;
  }
  body.dg-bg-safe .dg-journey.dg-journey-ready .dg-scene[data-stage="work"] .dg-v16-product-info{
    margin-top:8px!important;
  }
  body.dg-bg-safe .dg-journey.dg-journey-ready .dg-scene[data-stage="web"] .dg-scene-interface,
  body.dg-bg-safe .dg-journey.dg-journey-ready .dg-scene[data-stage="apps"] .dg-scene-interface{
    max-width:min(100%,750px)!important;
  }
}

/* Compact phones and landscape phones: allow the actual product detail,
   carousel controls, and agent action to fit ABOVE the fixed footer.
   Do not clip the whole scene or transform its 3D parent. */
@media(max-width:700px) and (max-height:760px){
  body.dg-bg-safe .dg-journey.dg-journey-ready .dg-scene:is(
    [data-stage="ai"],[data-stage="work"]
  ) .dg-scene-inner{
    padding:68px 0 24px!important;
    gap:7px!important;
    justify-content:flex-start!important;
  }
  body.dg-bg-safe .dg-scene:is([data-stage="ai"],[data-stage="work"]) .dg-scene-copy h2{
    font-size:clamp(29px,8.2vw,37px)!important;
    line-height:1.035!important;
    letter-spacing:-.057em!important;
    margin:5px 0 8px!important;
  }
  body.dg-bg-safe .dg-scene:is([data-stage="ai"],[data-stage="work"]) .dg-scene-copy>p{
    font-size:clamp(11px,3.1vw,12.5px)!important;
    line-height:1.32!important;
    max-width:43ch!important;
  }
  body.dg-bg-safe .dg-scene:is([data-stage="ai"],[data-stage="work"]) .dg-scene-link{
    min-height:33px!important;
    margin-top:7px!important;
    padding:8px 11px!important;
    font-size:10px!important;
  }
  body.dg-bg-safe .dg-scene:is([data-stage="ai"],[data-stage="work"]) .dg-scene-interface{
    margin-top:1px!important;
    flex:0 1 auto!important;
  }
  body.dg-bg-safe .dg-scene[data-stage="work"] .dg-software-collection,
  body.dg-bg-safe .dg-journey-ready .dg-scene[data-stage="work"] .dg-software-collection{
    height:clamp(116px,18.5svh,145px)!important;
  }
  body.dg-bg-safe .dg-journey-ready .dg-scene[data-stage="work"] .dg-software-logo:nth-child(n){
    height:clamp(110px,17svh,135px)!important;
    top:46%!important;
    gap:3px!important;
  }
  body.dg-bg-safe .dg-journey-ready .dg-scene[data-stage="work"] .dg-software-logo:nth-child(n) .dg-software-mark{
    width:min(99px,73%)!important;
    height:auto!important;
    aspect-ratio:1;
  }
  body.dg-bg-safe .dg-scene[data-stage="ai"] .dg-agents-grid,
  body.dg-bg-safe .dg-journey-ready .dg-scene[data-stage="ai"] .dg-agents-grid{
    height:clamp(155px,22svh,182px)!important;
  }
  body.dg-bg-safe .dg-scene[data-stage="ai"] .dg-agent-visual:nth-child(n){
    width:min(36%,124px)!important;
  }
  body.dg-bg-safe .dg-scene:is([data-stage="ai"],[data-stage="work"]) .dg-v9-carousel-controls{
    margin-top:0!important;
    gap:3px!important;
  }
  body.dg-bg-safe .dg-scene:is([data-stage="ai"],[data-stage="work"]) .dg-v11-carousel-hint{
    font-size:7px!important;
    line-height:1.15!important;
    margin:0!important;
  }
  body.dg-bg-safe .dg-scene[data-stage="work"] .dg-v16-product-info{
    margin-top:5px!important;
    padding:8px 10px!important;
    gap:4px!important;
    max-height:clamp(126px,23svh,158px)!important;
    overflow-y:auto!important;
    overscroll-behavior:contain;
    scrollbar-width:thin;
  }
  body.dg-bg-safe .dg-scene[data-stage="work"] .dg-v16-product-info strong{
    font-size:clamp(12px,3.3vw,15px)!important;
    line-height:1.15!important;
  }
  body.dg-bg-safe .dg-scene[data-stage="work"] .dg-v16-product-promise{
    font-size:clamp(10px,2.9vw,12px)!important;
    line-height:1.22!important;
  }
  body.dg-bg-safe .dg-scene[data-stage="work"] .dg-v16-product-description{
    font-size:clamp(10px,2.8vw,12px)!important;
    line-height:1.33!important;
  }
  body.dg-bg-safe .dg-scene[data-stage="work"] .dg-v16-product-features{
    gap:3px!important;
    margin:0!important;
  }
  body.dg-bg-safe .dg-scene[data-stage="work"] .dg-v16-product-features li{
    font-size:9px!important;
    padding:3px 7px!important;
  }
  body.dg-bg-safe .dg-scene[data-stage="work"] .dg-v10-carousel-open{
    min-height:32px!important;
    padding:7px 11px!important;
    font-size:10px!important;
  }
  body.dg-bg-safe .dg-scene[data-stage="ai"] .dg-v10-carousel-info{
    padding:8px 9px!important;
    gap:6px!important;
  }
}

/* Exceptionally narrow screens: text wraps safely instead of intruding
   into the next controls or disappearing under the scene footer. */
@media(max-width:360px){
  body.dg-bg-safe .dg-scene-copy h2{
    overflow-wrap:normal!important;
    hyphens:auto;
  }
  body.dg-bg-safe .dg-scene[data-stage="work"] .dg-v16-product-features li{
    overflow-wrap:anywhere!important;
  }
}


/* Short-screen final fit: V39's high-specificity planet dimensions would
   otherwise override the compact rules above, letting the product panel
   disappear below the bottom safe area on 320–375px Android screens. */
@media(max-width:700px) and (max-height:760px){
  body.dg-bg-safe.dg-atmosphere-home .dg-journey.dg-journey-ready .dg-scene[data-stage="work"] .dg-software-collection{
    height:clamp(110px,16.5svh,126px)!important;
    min-height:0!important;
  }
  body.dg-bg-safe.dg-atmosphere-home .dg-journey.dg-journey-ready .dg-scene[data-stage="work"] .dg-software-logo:nth-child(n){
    height:clamp(106px,16svh,124px)!important;
    top:46%!important;
  }
  body.dg-bg-safe.dg-atmosphere-home .dg-journey.dg-journey-ready .dg-scene[data-stage="work"] .dg-software-logo:nth-child(n) .dg-software-mark{
    width:min(96px,73%)!important;
    height:auto!important;
    aspect-ratio:1;
  }
}


/* The product CTA is a SIBLING after the detail card (not inside it).
   On 320–375px short phones its full height must remain above the scene
   footer, so reserve the last ~30px instead of only fitting the card. */
@media(max-width:700px) and (max-height:760px){
  body.dg-bg-safe.dg-atmosphere-home .dg-scene[data-stage="work"] .dg-v16-product-info{
    max-height:clamp(110px,19svh,132px)!important;
  }
  body.dg-bg-safe.dg-atmosphere-home .dg-scene[data-stage="work"] .dg-v10-carousel-open{
    margin-top:4px!important;
    min-height:31px!important;
  }
}


/* Short phone details: one compact product panel with a permanently
   visible external CTA at the bottom. Scroll only the description region,
   not the action. This preserves all product information and keyboard/
   touch navigation without clipping the action underneath the footer. */
@media(max-width:700px) and (max-height:760px){
  body.dg-bg-safe.dg-atmosphere-home .dg-journey.dg-journey-ready .dg-scene[data-stage="work"] .dg-v16-product-info{
    display:flex!important;
    flex-direction:column!important;
    align-items:stretch!important;
    gap:4px!important;
    height:clamp(140px,23svh,158px)!important;
    max-height:clamp(140px,23svh,158px)!important;
    overflow:hidden!important;
  }
  body.dg-bg-safe.dg-atmosphere-home .dg-journey.dg-journey-ready .dg-scene[data-stage="work"] .dg-v16-product-info>div{
    flex:1 1 auto!important;
    min-height:0!important;
    max-width:100%!important;
    padding-right:4px;
    overflow-y:auto!important;
    overflow-x:hidden!important;
    overscroll-behavior:contain;
    -webkit-overflow-scrolling:touch;
    scrollbar-width:thin;
  }
  body.dg-bg-safe.dg-atmosphere-home .dg-journey.dg-journey-ready .dg-scene[data-stage="work"] .dg-v16-product-info .dg-v10-carousel-open{
    flex:0 0 auto!important;
    align-self:flex-start!important;
    justify-self:start!important;
    min-height:31px!important;
    margin:0!important;
    white-space:nowrap;
  }
}
