/* =====================================================================
   LEADS polish layer — loaded last on every page.
   1  Icons that broke on phones (menu, tile arrows, buttons, hero mark)
   2  One shared motion curve and calmer reveal timing
   3  Project page text + gallery timing
   4  Touch-device fixes (fixed backgrounds, hover-only content)
   ===================================================================== */
:root{
  --ease-out:cubic-bezier(.16,1,.3,1);
  --ease-soft:cubic-bezier(.33,1,.68,1);
  --ease-io:cubic-bezier(.65,0,.35,1);
}

/* ---------- 1. ICONS ------------------------------------------------ */
/* An icon box must never be squeezed by the label next to it. */
.button>b,
a.action>span,
.case-edge>span,
.hero-project>span,
.case-bottom a svg,
.work-tile small svg,
.zoom-open,
.service-icon{flex:none}
.ui-icon{flex:0 0 auto;min-width:0}
.button>b svg{width:19px;height:19px;flex:none}
.button.small>b svg{width:17px;height:17px}

/* Pricing buttons: icon + label fit even in a narrow card. */
.price-card .button{width:100%;justify-content:flex-start;gap:12px;white-space:nowrap}
.price-card .button>span{overflow:hidden;text-overflow:ellipsis}

.price-card li{display:flex;align-items:flex-start;gap:10px}
.price-card li svg{flex:none;width:16px;height:16px;margin-top:.22em}

/* Footer + social icons keep their square. */
footer svg,.leads-directory svg{flex:none}

/* Hamburger / close icon. */
header .menu-button{position:relative;flex:none;-webkit-tap-highlight-color:transparent}
header .menu-button svg{width:22px;height:22px;transition:transform .45s var(--ease-out)}
header .menu-button[aria-expanded=true] svg{transform:rotate(90deg)}

@media(max-width:760px){
  /* Opening the menu used to throw "Let's talk" over the logo. Keep every
     element on its own row: brand + pill + button on top, links below. */
  header.open nav{left:0;right:0;top:0;width:100%;min-width:0;padding:66px 18px 14px;border-radius:26px;
    box-shadow:0 22px 60px #0a14281f;transform-origin:50% 0}
  header.open nav>.brand{position:absolute;left:12px;top:9px;margin:0;z-index:3}
  header.open .talk-pill{margin-left:auto}
  header.open nav>a:not(.brand){font-size:17px;border-bottom:1px solid #0911170f}
  header.open nav>a:not(.brand):last-child{border-bottom:0}
  @media(prefers-reduced-motion:no-preference){
    header nav{transition:border-radius .35s var(--ease-out)}
    header.open nav>a:not(.brand){animation:menu-link .5s var(--ease-out) both}
    header.open nav>a:nth-child(2){animation-delay:.04s}
    header.open nav>a:nth-child(3){animation-delay:.08s}
    header.open nav>a:nth-child(4){animation-delay:.12s}
    header.open nav>a:nth-child(5){animation-delay:.16s}
  }
  @keyframes menu-link{from{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:none}}
}

/* Hero mark and the diagonal label: the metal arrow was cut off at the right
   edge and the crosshair text ran off screen. */
@media(max-width:760px){
  .hero-crosshair>span,.hero-crosshair span{display:none!important}
  .opening .hero-editorial .hero-title-wrap{gap:14px}
  .opening .hero-editorial .hero-emblem{
    position:relative;left:auto;top:auto;right:auto;order:0;
    width:clamp(88px,28vw,128px);height:clamp(64px,20vw,92px);
    margin:0 auto;transform:none;opacity:1}
}

/* ---------- 2. MOTION TIMING ---------------------------------------- */
@media(prefers-reduced-motion:no-preference){
  html{scroll-behavior:smooth}
  .scroll-reveal{
    translate:0 34px;filter:none;
    transition:opacity .7s var(--ease-out) var(--reveal-delay,0ms),
               translate .9s var(--ease-out) var(--reveal-delay,0ms),
               transform .18s ease-out}
  .scroll-reveal.visible{filter:none}
  .reveal-on-scroll{translate:0 26px;transition:opacity .7s var(--ease-soft),translate .9s var(--ease-out)}
  .reveal-on-scroll.is-revealed{translate:0 0}
  .studio .agency-intro .reveal-on-scroll,.hello>.reveal-on-scroll{transition-duration:.6s}

  /* Smooth page-to-page cross-fade where the browser supports it. */
  @view-transition{navigation:auto}
  ::view-transition-old(root){animation:vt-out .2s ease both}
  ::view-transition-new(root){animation:vt-in .42s var(--ease-out) both}
  @keyframes vt-out{to{opacity:0}}
  @keyframes vt-in{from{opacity:0}}
}
.scroll-reveal,.reveal-on-scroll{backface-visibility:hidden}
.char,.scene-word span,.about-reveal-word{backface-visibility:hidden}

/* Buttons and links respond in the same time everywhere. */
a,button{-webkit-tap-highlight-color:transparent}
.button,.action,.hero-project,.talk-pill{transition-timing-function:var(--ease-soft)}

/* ---------- 3. PROJECT PAGES --------------------------------------- */
.sum-word{display:inline-block;will-change:transform,opacity}
.case-summary h1 .sum-word,.case-summary p .sum-word{backface-visibility:hidden}

@media(prefers-reduced-motion:no-preference){
  .case-gallery figure.reveal-on-scroll{translate:0 28px;scale:.985;
    transition:opacity .8s var(--ease-soft),translate 1s var(--ease-out),scale 1s var(--ease-out)}
  .case-gallery figure.reveal-on-scroll.is-revealed{translate:0 0;scale:1}
  .motion-copy .reveal-on-scroll,.motion-copy figure{scale:1;translate:none;opacity:1}
  .archive-grid .work-tile.opening-project{transform:scale(.975);transition:transform .17s var(--ease-soft)}
}

/* Project tiles on phones: the preview paragraph showed all the time, the
   title overflowed and the arrow was oversized. */
@media(hover:none),(max-width:760px){
  .archive-grid .work-preview{display:none}
  .studio .archive-grid .work-tile img{aspect-ratio:1.3}
  .studio .archive-grid .work-tile>div{display:flex;flex-direction:column;align-items:flex-start;gap:3px;
    padding:34px 11px 10px;opacity:1;translate:none}
  .archive-grid .work-tile strong{font-size:15px;line-height:1.15;letter-spacing:-.02em}
  .archive-grid .work-tile small{width:100%;display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:11px;line-height:1}
  .archive-grid .work-tile small svg{width:13px;height:13px}
}

/* ---------- 4. TOUCH DEVICES --------------------------------------- */
/* `fixed` backgrounds are not supported on iOS and repaint on every scroll
   frame elsewhere. */
@media(hover:none),(max-width:900px){
  .studio.home,.studio .services-showcase,.studio .texture-surface{background-attachment:scroll!important}
}
@media(max-width:640px){
  .pricing-grid{grid-template-columns:1fr!important}
  .services-showcase .service-tile .service-tags{flex-wrap:wrap}
}

/* Visible keyboard focus everywhere. */
:focus-visible{outline:2px solid var(--blue,#325feb);outline-offset:3px;border-radius:6px}
.brief-body :focus-visible{outline-color:#fff}

/* Safari needs the prefixed property for the glass metric cards. */
.intro-words .agency-metrics article,.intro-words .agency-metrics .metric-middle{-webkit-backdrop-filter:blur(9px);backdrop-filter:blur(9px)}
