/* Phone (max 760px) and tablet (761px to 1100px) polish for this page. Media queries only, loaded last: desktop above 1100px is untouched. */
/* ==== Shared phone and tablet rules (same block on every page) ==== */
@media (max-width:760px){
  /* running text: left aligned on phones, justified columns this narrow open wide gaps between words */
  body.justify-intro .intro-tile .lead,body.justify-intro .intro-tile .twocol p,body.justify-intro .intro-tile .based,
  body.justify-intro .svc .tagline,body.justify-intro .svc .body,body.justify-intro .train-band .tagline,body.justify-intro .train-band .body,
  body.justify-intro .post p:not(.cat),.split .body,.split .tagline,.tile p:not(.mono):not(.cat),
  .jp,.jus,.box p,.faq3 p,.qa3 p,.prose p,.prose li,.post .ex,.feat .ex,.art-ex,.ct-lead,.intro-p,
  .scene-hero .sc-lead,.scene-hero .sc-where,
  .index-intro .lead,.index-intro p,.shoot-head .lead,.mdl-body,.dir-body,.wa-lead,.wa-p,.g-list p,.design-head .lead,.design-paras p,
  .blog-card p,.cal-note p,.cp-head p,.more-tile p,.tp-body p,.sam-body,.relic-head p,.robo p{text-align:left!important}

  /* scene header: the animation shows in full at the top, its last glow fades into the black under the words */
  .scene-hero::after{background:linear-gradient(180deg,rgba(0,0,0,0) 0,rgba(0,0,0,0) 450px,#000 512px,#000 100%)}
  .scene-hero .sc-in{padding-top:500px}

  /* contact: the form comes first under the #contact anchor; the camera eye follows as a shorter closing image */
  body.contact-tiles .contact .formhalf{order:-1}
  body.contact-tiles .contact .cam{height:300px}
  .formhalf .h2 + form{margin-top:28px}
}

@media (min-width:761px) and (max-width:1100px){
  .wrap{padding:0 32px}
  .sh{column-gap:20px}
  .sh h2{font-size:52px}
  /* scene header: as on phones, the whole animation shows across the top (the 1440 x 760 still at full width)
     and the words start below it on black, so nothing covers the subject */
  .scene-hero{display:block;min-height:0;background-size:100% auto;background-position:center top}
  .scene-hero::after{background:linear-gradient(180deg,rgba(0,0,0,0) 0,rgba(0,0,0,0) calc(52.78vw - 80px),#000 calc(52.78vw - 4px),#000 100%)}
  .scene-hero .sc-in{padding:calc(52.78vw - 24px) 48px 64px}
  .scene-hero .sc-in > *{max-width:640px}
  .scene-hero h1{font-size:44px;max-width:640px}

  /* blog: lead post across the top, two below */
  .posts{grid-template-columns:1fr 1fr}
  .posts .lead-post{grid-column:1/-1}
  body.paper .lead-post h3{font-size:34px}

  /* contact: narrower camera eye, single-column form */
  body.contact-tiles .contact{padding:0 32px;gap:16px;grid-template-columns:5fr 7fr}
  .contact{min-height:0}
  .formhalf.pad{padding:52px 44px}
  .formhalf .h2{font-size:48px}
  .frow{grid-template-columns:1fr;gap:0}
  .send{flex-wrap:wrap;gap:18px 28px}

  /* four-step process rows: two by two */
  .steps{grid-template-columns:1fr 1fr;row-gap:36px}

  /* footer */
  .foot-top{grid-template-columns:1fr;gap:30px}
  .foot-right{align-items:flex-start}
  .foot-links{justify-content:flex-start}
}

/* ==== Operational AI ==== */
@media (max-width:760px){
  /* custom CRM: the desktop screen scrolls sideways at a readable size, the phone screen sits large beneath it */
  .crm-desk{overflow-x:auto;-webkit-overflow-scrolling:touch;margin:0 -20px;padding:0 20px;scrollbar-width:none}
  .crm-desk::-webkit-scrollbar{display:none}
  .crm-desk img{width:760px;margin:-10px -19px -10px -19px}
  .crm-phone{width:76%;margin:28px auto 0}
  .crm-stage .cap{margin-top:18px}

  /* two example builds: a little more room for the screens */
  .pair-g .shot-img img,.pair-g2 .shot-img img{width:104%;margin:-2%}

  /* seven steps: tidy the step card spacing */
  .flow li{padding-bottom:24px}
}
@media (min-width:761px) and (max-width:1100px){
  #how .how-box{padding:48px 44px 40px}
  .audit-top{grid-template-columns:1fr;gap:34px;margin-bottom:44px}
  .audit-top .two-lists{grid-template-columns:1fr 1fr;gap:36px}

  /* seven steps: a vertical timeline, as on phones, with the text running wide */
  .flow{grid-template-columns:1fr;row-gap:0}
  .flow li{display:grid;grid-template-columns:84px 1fr;column-gap:24px;padding-bottom:30px}
  .flow li:not(:last-child)::before{left:41px;right:auto;top:64px;bottom:0;width:2px;height:auto}
  .flow li:not(:last-child)::after{display:none}
  .fn{grid-row:1/3;font-size:60px;padding:0 0 8px;text-align:center;width:84px}
  .flow h4{margin:6px 0 6px;font-size:24px}
  .flow p{max-width:620px}
  .flow-cta{margin-top:30px}

  .crm-intro,.brand-line,.auto-top,.rep-top{grid-template-columns:1fr;gap:18px}
  .big-line,.brand-line h3{font-size:40px}
  .crm-stage{padding-right:170px}
  .crm-phone{width:230px;bottom:30px}
  .types{grid-template-columns:1fr 1fr;column-gap:36px}
  .routes2{column-gap:36px}

  .ag-grid{grid-template-columns:1fr;gap:52px}
  .ag-lead{font-size:36px}

  .au-list{grid-template-columns:1fr 1fr;column-gap:36px}
  .au-list li:nth-child(n+4){border-bottom:1px solid #d6d2c8}
  .au-list li:nth-last-child(-n+2){border-bottom:0}

  .red-in{grid-template-columns:1fr;gap:28px}
  .red-line{font-size:50px}

  .rep{grid-template-columns:1fr;gap:28px}
  .rep-fig{margin:0}
  .rep-fig .cap{padding-left:0}

  .more-row{grid-template-columns:repeat(3,1fr);row-gap:34px}

  .robo3 .rb-copy{max-width:470px;padding:60px 0 60px 52px}
  .robo3 h2{font-size:46px}

  .starts{grid-template-columns:1fr;gap:16px}
  .faq3{padding:8px 40px}
}

/* ==== Shorter phone layout (4 Oct): swipe rows for repeated cards, tighter rhythm. Phones only. ==== */
@media (max-width:760px){
  /* swipe row: the same style on every page. Cards are 82% of the screen so the next one peeks in,
     snapping to the 20px gutter; the row bleeds to the screen edges and hides its scrollbar */
  #how .flow,.pair-g,.types,.au-list,.more-row,.starts,#journal .posts{
    display:flex;gap:12px;overflow-x:auto;overflow-y:hidden;scroll-snap-type:x mandatory;scroll-padding:0 20px;
    margin-left:-20px;margin-right:-20px;padding:0 20px 2px;scrollbar-width:none;overscroll-behavior-x:contain}
  #how .flow::-webkit-scrollbar,.pair-g::-webkit-scrollbar,.types::-webkit-scrollbar,
  .au-list::-webkit-scrollbar,.more-row::-webkit-scrollbar,.starts::-webkit-scrollbar,#journal .posts::-webkit-scrollbar{display:none}
  .pair-g > *,.au-list > *,.more-row > *,.starts > *,#journal .posts > *{flex:0 0 82vw;max-width:82vw;scroll-snap-align:start;min-width:0}

  /* tighter section rhythm */
  .sec{padding-top:56px}
  .sh{margin-bottom:24px}
  .big-n{font-size:64px}
  .sh .kicker.kn{gap:8px}

  /* 01 how it starts: the seven steps swipe inside the white box, joined by the red line as on desktop */
  #how .how-box{padding:28px 22px 26px}
  .audit-top{gap:24px;margin-bottom:28px}
  .two-lists{gap:22px}
  #how .flow{margin-left:-22px;margin-right:-22px;padding:0 22px 2px;scroll-padding:0 22px;gap:18px}
  #how .flow li{display:block;flex:0 0 76%;max-width:76%;scroll-snap-align:start;padding-bottom:4px}
  #how .flow li:not(:last-child)::before{left:0;right:-18px;top:21px;bottom:auto;width:auto;height:2px}
  #how .flow li:not(:last-child)::after{display:block;right:-21px;top:18px}
  #how .flow .fn{display:inline-block;width:auto;font-size:44px;padding:0 12px 0 0;text-align:left}
  #how .flow h4{margin:14px 0 6px}
  .flow-cta{margin-top:22px}
  /* what we look at / what you get: side by side in a swipe row inside the box */
  .audit-top .two-lists{display:flex;gap:18px;overflow-x:auto;overflow-y:hidden;scroll-snap-type:x mandatory;scroll-padding:0 22px;
    margin:0 -22px;padding:0 22px 2px;scrollbar-width:none;overscroll-behavior-x:contain}
  .audit-top .two-lists::-webkit-scrollbar{display:none}
  .audit-top .two-lists > *{flex:0 0 76%;max-width:76%;scroll-snap-align:start;min-width:0}

  /* 02 software: smaller phone screen, the two example builds swipe, the nine build types swipe in two rows */
  /* the desktop and phone screens of the custom CRM share one swipe row (the wide desktop screen pans first) */
  .crm-stage{display:grid;grid-template-columns:722px 226px;column-gap:16px;align-items:end;overflow-x:auto;overflow-y:hidden;
    scroll-snap-type:x proximity;scroll-padding:0 20px;margin:0 -20px;padding:0 20px 2px;scrollbar-width:none;overscroll-behavior-x:contain}
  .crm-stage::-webkit-scrollbar{display:none}
  .crm-stage .crm-desk{overflow:visible;margin:0;padding:0;scroll-snap-align:start}
  .crm-stage .crm-phone{width:226px;margin:0;scroll-snap-align:end}
  .crm-stage .cap{grid-column:1/-1;position:sticky;left:0;width:calc(100vw - 40px);justify-self:start}
  .brand-line{margin-top:40px}
  .pair-g{margin-top:0}
  .pair-g .shot .cap{margin-top:10px}
  .types{display:grid;grid-template-columns:none;grid-auto-flow:column;grid-template-rows:auto auto;grid-auto-columns:82vw;column-gap:12px;border-top:0}
  .types li{scroll-snap-align:start;padding:18px 0;border-top:1px solid #d6d2c8;border-bottom:0}
  .types li:nth-child(even){border-bottom:1px solid #d6d2c8}
  .types li:last-child{border-bottom:1px solid #d6d2c8}
  /* the two routes swipe as a pair; the note under them stays put */
  .routes2{display:grid;grid-template-columns:repeat(2,82vw);column-gap:12px;row-gap:22px;margin:32px -20px 0;padding:0 20px 2px;
    overflow-x:auto;overflow-y:hidden;scroll-snap-type:x mandatory;scroll-padding:0 20px;scrollbar-width:none;overscroll-behavior-x:contain}
  .routes2::-webkit-scrollbar{display:none}
  .routes2 > div{scroll-snap-align:start;min-width:0}
  .routes2 .routes-note{grid-column:1/-1;position:sticky;left:0;width:calc(100vw - 40px);justify-self:start;margin-top:0}

  /* 03 agents: tighter */
  .ag-grid{gap:36px;grid-template-columns:minmax(0,1fr)}
  .ag-copy{min-width:0}
  .ag-jobs-h{margin:26px 0 10px}
  /* the six example jobs swipe in two rows, like the build types */
  .ag-jobs{display:grid;grid-template-columns:none;grid-auto-flow:column;grid-template-rows:auto auto;grid-auto-columns:82vw;gap:0 12px;
    overflow-x:auto;overflow-y:hidden;scroll-snap-type:x mandatory;scroll-padding:0 20px;margin:0 -20px;padding:0 20px 2px;scrollbar-width:none;overscroll-behavior-x:contain}
  .ag-jobs::-webkit-scrollbar{display:none}
  .ag-jobs li{padding:14px 0;scroll-snap-align:start}
  .ag-jobs li:nth-child(even){border-bottom:1px solid #26262b}
  .ac-rows li{padding:13px 18px}

  /* 04 automations: the six kinds of automation swipe */
  /* where AI helps / how we build them: the two notes swipe as a pair */
  .auto-how{display:flex;gap:12px;overflow-x:auto;overflow-y:hidden;scroll-snap-type:x mandatory;scroll-padding:0 20px;
    margin:0 -20px;padding:0 20px 2px;scrollbar-width:none;overscroll-behavior-x:contain}
  .auto-how::-webkit-scrollbar{display:none}
  .auto-how > *{flex:0 0 82vw;max-width:82vw;scroll-snap-align:start;min-width:0}
  .au-list{margin-top:28px;border-top:0}
  .au-list li,.au-list li:nth-child(n+4),.au-list li:last-child{border-top:3px solid #141418;border-bottom:0;padding:18px 0 4px}

  /* 05 reports: a little tighter */
  .big-line{font-size:28px}
  .rep{row-gap:18px}
  .rep-text .ticks li{margin-bottom:7px}
  .robo3 .rb-art img{aspect-ratio:16/9}

  /* 06 more: the six other uses swipe */
  .more-row{row-gap:0}

  /* 08 ways to start: the three options swipe, one height */
  .starts{align-items:stretch}

  /* questions: a little less padding round each question (still a large tap area) */
  .qa3 summary{padding:17px 0}

  /* blog: the three posts swipe, one card size */
  body.paper .lead-post h3,body.paper .post h3{font-size:24px}
  body.paper .post figure,body.paper .lead-post figure{aspect-ratio:3/2;margin-bottom:16px}
  body.paper .post{padding:10px 10px 22px}

  /* contact: shorter closing camera eye */
  body.contact-tiles .contact .cam{height:200px}
  .formhalf .h2 + form{margin-top:22px}
  /* contact form: name and email side by side */
  .formhalf .frow{grid-template-columns:1fr 1fr;gap:14px}
}
