/* ============================================================= */
/* MOBILE OPTIMIZATIONS - shared across all pages                  */
/* Loaded AFTER inline <style>, so it overrides where needed.      */
/* ============================================================= */

/* Prevent horizontal overflow globally */
html, body { overflow-x: hidden; max-width: 100%; }

/* ============================================================= */
/* <= 900px  -  tablet / large mobile                              */
/* ============================================================= */
@media (max-width: 900px){

  /* ---------- CENTER-ALIGN ALL CONTENT  ---------- */
  .wrap,
  .hero__headline,
  .intro__top, .intro__body, .intro__headline, .intro__copy, .intro__tag,
  .pillar__body, .pillar__lede, .pillar__eyebrow, .pillar__title,
  .section-title, .section__title,
  .team-title-wrap, .team-title,
  .careers__row, .careers__lede, .careers__title, .careers__col,
  .contact__row, .contact__title, .contact__info, .contact__intro,
  .clients__row, .clients__title, .clients__copy, .clients__head,
  .ourclients, .ourclients__title,
  .services,
  .foot, .foot__top, .foot__bottom, .foot__col{
    text-align: center;
  }

  /* Center list items & flex groups */
  .pillar__list li{ justify-content: center; }
  .intro__top{ align-items: center !important; }
  .clients__head{ align-items: center !important; }

  /* Center buttons */
  .btn,
  .intro__top .btn,
  .contact__form .btn{
    justify-self: center !important;
    margin-left: auto;
    margin-right: auto;
  }

  /* Center form labels/fields */
  .contact__form label{ text-align: center; }
  .contact__form input,
  .contact__form textarea{ text-align: center; }

  /* Center slider captions & controls */
  .pillar__slider__controls{ align-items: center !important; }
  .pillar__slider__nav{ align-self: center !important; }
  .pillar__slider__hint{ text-align: center; }

  /* Footer */
  .foot__bottom{ align-items: center !important; }
  .foot__ctas{ align-items: stretch; }

  /* ---------- NAV  ---------- */
  .nav{ padding: 0 20px; }

  /* ---------- HERO  ---------- */
  .hero{
    height: min(78vh, 640px);
    min-height: 480px;
  }
  .hero__headline{
    top: 16px;
    padding: 0 20px;
  }
  .hero__badge{ bottom: 44px; }
  .hero__badge .pill{
    font-size: 20px;
    padding: 9px 26px 11px;
  }

  /* ---------- INTRO  ---------- */
  .intro{ padding: 48px 0 72px; }
  .intro__top .btn{
    min-width: 0;
    width: 100%;
  }
  .intro__headline{ font-size: clamp(36px, 10vw, 72px); }

  /* ---------- PAGE LOGO  ---------- */
  .pagelogo{ padding: 18px 0; }
  .pagelogo a{
    font-size: 22px;
    padding: 7px 16px 9px;
  }

  /* ---------- PILLAR SECTIONS  ---------- */
  .pillar{ padding: 72px 0 80px; }
  .pillar__title{
    font-size: clamp(56px, 15vw, 110px);
    margin: 0 0 32px;
  }
  .pillar__body{ grid-template-columns: 1fr; gap: 32px; }
  .pillar__lede{ font-size: 16px; max-width: none; }
  .pillar__list{ grid-template-columns: 1fr; }
  .pillar__list li{
    font-size: 13px;
    padding: 18px 0;
  }

  /* ---------- GENERIC BIG SECTION TITLES  ---------- */
  .section-title,
  .section__title,
  .team-title,
  .careers__title,
  .contact__title,
  .ourclients__title,
  .clients__title{
    font-size: clamp(48px, 13vw, 88px) !important;
    line-height: .92 !important;
  }

  /* ---------- CLIENTS / TEAM / CAREERS / CONTACT  ---------- */
  .clients{ padding: 56px 0 68px; }
  .clients__row{ grid-template-columns: 1fr; gap: 24px; }
  .clients__head{ flex-direction: column; align-items: flex-start; }
  .clients__video{ width: 100%; aspect-ratio: 16/9; }

  .team-title-wrap{ padding: 48px 0 28px; }
  .team{ padding: 0 0 56px; }
  .team__grid{ grid-template-columns: repeat(2, 1fr); gap: 20px; }

  .careers{ padding: 72px 0 80px; }
  .careers__row{ grid-template-columns: 1fr; gap: 28px; }
  .careers__lede{ font-size: 16px; }

  .contact{ padding: 72px 0 80px; }
  .contact__row{ grid-template-columns: 1fr; gap: 28px; }
  .contact__form input,
  .contact__form textarea{ font-size: 16px; } /* prevents iOS zoom-on-focus */

  .ourclients{ padding: 60px 0 72px; }
  .ourclients__grid{ grid-template-columns: repeat(2, 1fr) !important; gap: 1px !important; }

  /* ---------- SERVICES TILES  ---------- */
  .services{ padding: 40px 0 60px; }
  .services__grid{ grid-template-columns: 1fr; gap: 10px; }
  .tile{ aspect-ratio: auto; min-height: 0; }
  .tile img{ position: static; width: 100%; height: auto; object-fit: cover; }

  /* ---------- CONTENT SLIDER  ---------- */
  .pillar__slider{ margin-top: 36px; }
  .pillar__slide{ flex: 0 0 calc((100% - 16px) / 2); }
  .pillar__slider__controls{
    margin-top: 20px;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
  .pillar__slider__nav{ align-self: flex-end; }

  /* ---------- ART DIRECTION STRIP  ---------- */
  .pillar__imgstrip{
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 36px;
  }

  /* ---------- FOOTER  ---------- */
  .foot{ padding: 48px 0 32px; }
  .foot__top{
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .foot__ctas{
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }
  .foot__ctas .btn{ width: 100%; text-align: center; }
  .foot__bottom{
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
}

/* ============================================================= */
/* <= 640px  -  phone portrait                                     */
/* ============================================================= */
@media (max-width: 640px){
  .wrap{ padding-left: 24px !important; padding-right: 24px !important; }

  /* Typography down one notch */
  body{ font-size: 15px; }

  .nav__logo{ font-size: 16px; }

  .hero{
    height: min(82vh, 580px);
    min-height: 460px;
  }
  .hero__headline{
    flex-wrap: wrap;
    gap: .1em .25em;
    font-size: 10vw;
    line-height: .92;
  }
  .hero__badge{ bottom: 32px; gap: 10px; }
  .hero__badge .pill{
    font-size: 18px;
    padding: 8px 22px 10px;
  }
  .hero__badge .chev{ width: 14px; height: 14px; }

  .pagelogo a{ font-size: 20px; padding: 6px 14px 8px; }

  .pillar{ padding: 56px 0 64px; }
  .pillar__title{ font-size: clamp(44px, 14vw, 84px); }
  .pillar__eyebrow{ font-size: 10px; letter-spacing: .22em; }

  .intro{ padding: 40px 0 56px; }
  .intro__top{ margin-bottom: 32px; }
  .intro__body{ gap: 22px; }
  .intro__headline{ font-size: clamp(32px, 11vw, 60px); }
  .intro__copy{ font-size: 14px; }

  .section-title,
  .section__title,
  .team-title,
  .careers__title,
  .contact__title,
  .ourclients__title,
  .clients__title{
    font-size: clamp(40px, 14vw, 72px) !important;
  }

  .team__grid{ grid-template-columns: 1fr; }

  .pillar__slide{ flex: 0 0 78%; }
  .pillar__imgstrip{ grid-template-columns: 1fr; }

  .foot{ padding: 40px 0 28px; }
  .foot__ctas .btn{ font-size: 12px; padding: 14px 24px; }

  /* Prevent any element forcing overflow */
  img, video, iframe{ max-width: 100%; }
}

/* ============================================================= */
/* ART DIRECTION IMAGE STRIP SLIDER (new slider-based strip)       */
/* ============================================================= */
@media (max-width: 900px){
  .pillar__imgstrip__track{
    grid-auto-columns: calc((100% - 8px) / 2) !important;
  }
}
@media (max-width: 480px){
  .pillar__imgstrip__track{
    grid-auto-columns: 82% !important;
  }
  .pillar__imgstrip__controls{ justify-content: center; }
}

/* ============================================================= */
/* CONTENT VIDEO SLIDER                                            */
/* ============================================================= */
@media (max-width: 900px){
  .pillar__slide{
    flex: 0 0 calc((100% - 8px) / 2) !important;
  }
}
@media (max-width: 560px){
  .pillar__slide{
    flex: 0 0 85% !important;
  }
}
@media (max-width: 900px){
  .pillar__slider__controls{ flex-direction: row; align-items: center; justify-content: flex-end; gap: 8px; }
}

/* ============================================================= */
/* WE WORK WITH — loghi gif                                       */
/* ============================================================= */
@media (max-width: 900px){
  .clients__loghi{ width: 100px !important; height: 100px !important; }
  .clients__with-row{ align-items: flex-start; }
  .clients__headline{ font-size: clamp(40px, 13vw, 88px) !important; }
}
@media (max-width: 560px){
  .clients__loghi{ width: 80px !important; height: 80px !important; }
}

/* ============================================================= */
/* DIGITAL NEEDS HOME                                              */
/* ============================================================= */
@media (max-width: 900px){
  .dnhome__grid{ grid-template-columns: 1fr !important; gap: 36px !important; }
  .dnhome__logo img{ max-width: 280px !important; margin: 0 auto; }
}

/* ============================================================= */
/* TEAM SECTION — horizontal scroll on mobile                     */
/* ============================================================= */
@media (max-width: 900px){
  .team-title-wrap{ padding: 36px 0 20px; }
}

/* ============================================================= */
/* WE WORK WITH — center on mobile                                */
/* ============================================================= */
@media (max-width: 900px){
  .clients__headline-stack,
  a.clients__glitch{
    align-items: center;
    text-align: center;
  }
  .clients__with-row{
    justify-content: center !important;
    align-items: center !important;
  }
  .clients__loghi{
    margin: 8px auto 0 !important;
  }
  .clients__head{
    justify-items: center;
    text-align: center;
  }
  .clients__copy{
    align-items: center !important;
    text-align: center;
  }
  .clients__copy p{ text-align: center; }
  .clients__cta{
    margin-left: auto !important;
    margin-right: auto !important;
    display: block;
    width: fit-content;
  }
}

/* ============================================================= */
/* SECTION TITLES — prevent overflow / clip on mobile            */
/* ============================================================= */
@media (max-width: 640px){
  .pillar__title{
    font-size: clamp(28px, 8.5vw, 56px) !important;
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
    white-space: normal !important;
    line-height: .9 !important;
  }
  .clients__headline{
    font-size: clamp(34px, 10vw, 68px) !important;
    overflow-wrap: break-word;
    word-break: break-word;
    white-space: normal !important;
  }
  .intro__headline{
    overflow-wrap: break-word;
    word-break: break-word;
    white-space: normal !important;
  }
}
@media (max-width: 420px){
  .pillar__title{
    font-size: clamp(24px, 7.5vw, 44px) !important;
    white-space: normal !important;
  }
}

/* ============================================================= */
/* <= 420px  -  small phones                                       */
/* ============================================================= */
@media (max-width: 420px){
  .wrap{ padding-left: 18px !important; padding-right: 18px !important; }
  .hero__headline{ font-size: 11vw; }
  .pillar__title{ font-size: clamp(32px, 9vw, 52px) !important; }
  .intro__headline{ font-size: 30px; }
  .pillar__slide{ flex: 0 0 92% !important; }
  .pillar__imgstrip__track{ grid-auto-columns: 92% !important; }
}

/* ============================================================= */
/* GLOBAL — prevent text / title clip on any screen size          */
/* ============================================================= */
@media (max-width: 900px){
  /* All big display titles: wrap and never clip */
  .pillar__title,
  .clients__headline,
  .intro__headline,
  .hero__title,
  .team-title,
  .careers__title,
  .contact__title,
  .ourclients__title,
  h1, h2{
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
    overflow: visible !important;
    max-width: 100%;
  }

  /* Portfolio case-study hero titles */
  .hero__title{
    font-size: clamp(52px, 12vw, 100px) !important;
    line-height: .9 !important;
  }

  /* Prevent any section clipping its children's text */
  .pillar, .intro, .services, .team, .clients, .contact, .careers,
  .dnhome, .ourclients{
    overflow: visible !important;
  }

  /* Tile text: never overflow-hidden for the label */
  .tile .tile__label{
    overflow: visible !important;
  }
}

/* ============================================================= */
/* SERVICES TILE LABELS — prevent clip on all small screens       */
/* ============================================================= */
@media (max-width: 900px){
  /* Allow label to overflow the tile without being clipped */
  .tile{
    overflow: visible !important;
  }
  .tile__label{
    white-space: normal !important;
    text-align: center;
    font-size: 10px !important;
    letter-spacing: .08em !important;
    padding: 7px 12px !important;
    width: 84% !important;
    line-height: 1.45;
  }
}
@media (max-width: 640px){
  .tile__label{
    font-size: 9.5px !important;
    letter-spacing: .07em !important;
    padding: 6px 11px !important;
    width: 86% !important;
  }
}
@media (max-width: 420px){
  .tile__label{
    font-size: 9px !important;
    letter-spacing: .06em !important;
    width: 90% !important;
  }
}

/* ============================================================= */
/* FOOTER LOGO — compact pill on mobile (match hero pill)         */
/* ============================================================= */
@media (max-width: 900px){
  .foot__logo{
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
  }
}

/* ============================================================= */
/* FOOTER SOCIAL — centered on mobile                             */
/* ============================================================= */
@media (max-width: 900px){
  .foot__social{
    justify-content: center;
    width: 100%;
  }
}

/* ============================================================= */
/* TEAM — full-bleed centering on mobile with arrow nav           */
/* ============================================================= */
@media (max-width: 900px){
  /* Remove wrap padding so black band goes edge-to-edge */
  section.team.wrap{
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  /* Remove mask that visually clips edge cards */
  .team__viewport{
    -webkit-mask-image: none !important;
            mask-image: none !important;
  }
  /* Add inner padding via track so first/last card aren't flush */
  .team__track{
    padding-left: 20px;
    padding-right: 20px;
  }
  .team__arrow{
    width: 36px !important;
    height: 36px !important;
    display: flex !important;
  }
  .team__arrow--prev{ left: 4px !important; }
  .team__arrow--next{ right: 4px !important; }
}
@media (max-width: 640px){
  .team__track .member{
    flex: 0 0 160px !important;
    max-width: none !important;
  }
  .team__track{
    padding-left: 16px;
    padding-right: 16px;
  }
}
@media (max-width: 420px){
  .team__track .member{
    flex: 0 0 140px !important;
  }
  .team__track{
    padding-left: 12px;
    padding-right: 12px;
  }
}
