/* =========================================================================
   T2 Studio — mobile refinements (draft 2.1.25)
   Loaded only at 820px and below (media attribute on the <link>), so desktop pays nothing.
   To remove every change in this file: delete it and the 't2-mobile' enqueue line in functions.php.
   Companion script: assets/js/mobile.js
   ========================================================================= */

/* ---- E4: number labels on grey surfaces were 4.17:1; this grey is 4.9:1 on #f5f5f5 ---- */
:root{--t2-quiet:#6b6b6b}
html{-webkit-tap-highlight-color:rgba(0,0,0,.08)}

/* ---- B1: header = logo + Menu. The CTA lives in the menu and in the bottom bar (F1) ---- */
html:not(.nav-open) .site-header .nav{display:none}
.nav-toggle{min-width:44px;min-height:48px;padding:0 0 0 12px;margin-right:-2px}
.wordmark{min-height:44px}

/* ---- B3: full-width, thumb-sized CTA inside the open menu ---- */
html.nav-open .nav .nav-cta{align-self:stretch;display:flex;align-items:center;justify-content:center;min-height:52px;margin-top:var(--s4);font-size:16px}

/* ---- E1: 44px touch targets (hit areas grow, the look barely changes) ---- */
.fm-col a{padding:12px 0;line-height:1.4;min-width:44px}
.socials a{width:44px;height:44px}
.link-arrow{position:relative}
.link-arrow::after{content:"";position:absolute;inset:-14px 0}
.crumb a{position:relative;display:inline-block}
.crumb a::after{content:"";position:absolute;inset:-14px -8px}
.case-index a{display:inline-flex;align-items:center;justify-content:center;min-height:44px;min-width:44px;padding:0 6px}
.view button{min-height:44px;padding-left:16px;padding-right:16px}
.contact a[href^="mailto:"],.contact a[href*="linkedin.com"],.form-col a[href^="mailto:"],.form-col a[href*="linkedin.com"]{display:inline-flex;align-items:center;min-height:44px}

/* ---- C1 (alternative): no size changes; tighter tracking so small capitals read cleaner ---- */
.eyebrow,.fm-h{letter-spacing:.15em}   /* was .18em: a small tightening, same sizes */

/* ---- D1: press feedback for touch (hover rules are removed on touch devices by mobile.js) ---- */
@media (hover:none){
  .btn:not(.btn--light):not(.btn--solid):active{background:var(--t2-black);color:var(--t2-white)}
  .btn--solid:not(.btn--light):active{background:var(--t2-ink)}
  .btn--light:not(.btn--solid):active{background:var(--t2-white);color:var(--t2-black)}
  .btn--light.btn--solid:active{background:#ebe5db}
  .link-arrow:active .lbl{background-size:100% 1px}
  .wcard:active,.is-linkcard:active,.way:active{background-color:rgba(0,0,0,.045)}
  /* D2: About capability rows show their hairline permanently instead of waiting for a hover */
  .cap-row::before{transform:scaleX(1)}
}

/* ---- F1: sticky "Send a brief" bar (created by mobile.js, shown after the hero) ---- */
.sticky-cta{position:fixed;left:0;right:0;bottom:0;z-index:40;display:flex;align-items:center;justify-content:center;gap:12px;min-height:52px;padding:0 24px env(safe-area-inset-bottom,0);background:var(--t2-black);color:var(--t2-white);font:600 15px/1 var(--t2-sans);letter-spacing:.02em;text-decoration:none;border-top:1px solid rgba(255,255,255,.22);transform:translateY(100%);visibility:hidden;transition:transform .3s var(--ease),visibility 0s .3s}
.sticky-cta.is-on{transform:none;visibility:visible;transition:transform .3s var(--ease),visibility 0s}
.sticky-cta:active{background:#222}
.sticky-cta:focus-visible{outline:2px solid var(--t2-white);outline-offset:-5px}
.sticky-cta svg{width:22px;height:8px;flex:none}
html.nav-open .sticky-cta{display:none}
@media (prefers-reduced-motion:reduce){.sticky-cta,.sticky-cta.is-on{transition:none}}

/* ---- Rails (A2 case galleries, A5 home cases): shared look ---- */
.rail-wrap{position:relative}
.rail{position:relative;display:flex;align-items:flex-start;gap:12px;overflow-x:auto;overflow-y:hidden;scroll-snap-type:x mandatory;-webkit-overflow-scrolling:touch;overscroll-behavior-x:contain;scrollbar-width:none;margin-left:calc(-1 * var(--t2-pad));margin-right:calc(-1 * var(--t2-pad));padding:0 var(--t2-pad);scroll-padding-left:var(--t2-pad)}
.rail::-webkit-scrollbar{display:none}
.rail > *{flex:0 0 auto;scroll-snap-align:start;margin:0}
.rail:focus-visible{outline:2px solid currentColor;outline-offset:-3px}
.rail .rv,html.rv-on .rail .rv:not(.in){opacity:1}
html.rv-on .rail .rv.in{animation:none}
.rail-ctl{display:flex;align-items:center;gap:10px;margin-top:14px}
.rail-count{margin-right:auto;font:600 12px/1 var(--t2-sans);letter-spacing:.14em;color:var(--t2-body);font-variant-numeric:tabular-nums}
.rail-btn{width:44px;height:44px;display:grid;place-items:center;padding:0;border:1px solid var(--t2-black);background:transparent;color:var(--t2-black);cursor:pointer}
.rail-btn svg{width:18px;height:10px}
.rail-btn:active{background:var(--t2-black);color:var(--t2-white)}
.rail-btn[aria-disabled="true"]{opacity:.3;cursor:default}
.rail-emptied{display:none}

/* =========================================================================
   Phones only (700px and below)
   ========================================================================= */
@media (max-width:700px){

  /* ---- A1: section rhythm. Desktop paddings (104px, 150px closers) scaled for phones ---- */
  main > section.sec{padding-top:56px;padding-bottom:56px}
  main > section.bridge-sec{padding-top:48px;padding-bottom:48px}
  main > section.close,main > section.cta-band{padding-top:80px;padding-bottom:80px}
  main > section.case-sec{padding-top:56px;padding-bottom:56px}
  main > section.next-wrap{padding-top:40px;padding-bottom:40px}
  main > section.position{padding-top:56px;padding-bottom:24px}
  main > section.brought,main > section.ways{padding-top:56px;padding-bottom:56px}
  main > section.cases{padding-top:56px;padding-bottom:32px}
  main > section.logos .inner{padding-top:56px;padding-bottom:24px}
  main > section.intro{padding-top:56px;padding-bottom:24px}
  main > section.story{padding-top:40px}
  main > section.record{padding-top:40px;padding-bottom:56px}
  main > section.principles,main > section.brands,main > section.caps{padding-top:56px;padding-bottom:56px}
  main > section.archive{padding-top:32px;padding-bottom:56px}
  .chapter{padding-top:24px;padding-bottom:32px}
  .chapter-head{margin-bottom:20px;padding-top:16px}
  .case-row{margin-bottom:48px}

  /* ---- A3: case hero (text + detail cards) fits inside one screen ---- */
  .case-hero{padding:92px 0 108px}   /* bottom room: the hero image overlaps the hero by 90px */
  .case-hero .crumb{margin:0 0 14px;line-height:1.5}
  .case-hero h1{font-size:clamp(22px,6.3vw,27px);line-height:1.22}
  .case-hero .summary{margin-top:12px;font-size:14.5px;line-height:1.5}
  .case-hero .actions{margin-top:18px}
  .case-hero .actions .btn{min-height:44px;padding:11px 20px;font-size:14px}
  .meta-strip{grid-template-columns:1fr 1fr;gap:0 18px;margin:20px 0 0}
  .meta-strip > div{padding:12px 0 0}
  .meta-strip dt{font-size:11px;margin:0 0 3px}
  .meta-strip dd{font-size:12.5px;line-height:1.35}

  /* ---- A2: case-study galleries become swipe rails ---- */
  .rail--shots{--rail-h:clamp(250px,46svh,380px);align-items:center}
  body .chapter .rail--shots > figure{max-width:84vw}
  body .chapter .rail--shots figure img,body .chapter .rail--shots > img{display:block;width:auto;max-width:84vw;height:var(--rail-h);object-fit:contain;background:var(--t2-surface)}
  body .chapter .rail--shots > img{flex:0 0 auto}

  /* ---- A5: home — logo grid and a swipe rail for the featured cases ---- */
  .logo-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
  .logo-grid > div{height:68px;aspect-ratio:auto;padding:10px 8px;display:grid;place-items:center}
  .logo-grid > div img{max-width:100%;max-height:100%;width:auto;height:auto;object-fit:contain}
  .rail--cases > .case-row{flex:0 0 84%;max-width:360px;display:block}
  .rail--cases .case-row h3{font-size:19px;line-height:1.3}

  /* ---- A6: Work filters — one scrollable row of chips, smaller type ---- */
  .controls .wrap{display:flex;flex-direction:column;flex-wrap:nowrap;align-items:stretch;gap:12px;padding-top:16px;padding-bottom:16px}
  .filter,.ctrl-right{min-width:0}
  .ctrl-right{max-width:100%}
  .filter{display:flex;flex-wrap:nowrap;gap:8px;overflow-x:auto;scroll-snap-type:x proximity;scrollbar-width:none;-webkit-overflow-scrolling:touch;margin-left:calc(-1 * var(--t2-pad));margin-right:calc(-1 * var(--t2-pad));padding:2px var(--t2-pad) 4px}
  .filter::-webkit-scrollbar{display:none}
  .filter button{flex:none;scroll-snap-align:start;min-height:44px;padding:0 16px;font-size:13px;line-height:1;white-space:nowrap;border:1px solid var(--t2-line);background:transparent;color:var(--t2-body)}
  .filter button[aria-pressed="true"]{background:var(--t2-black);border-color:var(--t2-black);color:var(--t2-white)}
  .wcard h3{font-size:17px;line-height:1.3}

  /* ---- A4: accordion cards (Direct "starting points", Agency "partnership models") ---- */
  .disc{padding-top:16px;padding-bottom:16px}
  .disc .n{display:block;margin-bottom:6px}
  .disc > h3{margin:0}
  .disc-btn{display:flex;align-items:center;justify-content:space-between;gap:16px;width:100%;min-height:44px;margin:0;padding:6px 0;border:0;background:none;color:inherit;font:inherit;letter-spacing:inherit;text-align:left;cursor:pointer}
  .disc-btn::after{content:"";flex:none;width:14px;height:14px;background:linear-gradient(currentColor,currentColor) center / 100% 1.5px no-repeat,linear-gradient(currentColor,currentColor) center / 1.5px 100% no-repeat}
  .disc-btn[aria-expanded="true"]::after{background:linear-gradient(currentColor,currentColor) center / 100% 1.5px no-repeat}
  .disc-btn:focus-visible{outline:2px solid currentColor;outline-offset:3px}
  .disc-body{margin-top:8px}
  .disc:not(.is-open) .disc-body > :first-child{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;margin-bottom:0}
  .disc:not(.is-open) .disc-body > :not(:first-child){display:none}

  /* ---- C3: About story — smaller type, tighter spacing, nothing hidden ---- */
  .story .prose p{font-size:15px;line-height:1.6;margin-top:0;margin-bottom:12px}
  .story .label{margin-bottom:20px}

  /* ---- C3: case metrics — compact rows instead of tall stacked blocks ---- */
  .metric-strip{display:block}
  .metric{display:grid;grid-template-columns:minmax(88px,34%) 1fr;gap:16px;align-items:center;padding:12px 0}
  .metric .fig{font-size:28px;line-height:1.1}
  .metric .fig--phrase{font-size:19px;line-height:1.2}
  .metric p{font-size:14px;line-height:1.45;margin:0}

  /* ---- F2: whole card is tappable on phones (desktop keeps its own link behaviour) ---- */
  .case-row,.way,.next-case{position:relative}
  .case-row .read.link-arrow,.way .read.link-arrow,.next-case .go.link-arrow{position:static}
  .case-row .read.link-arrow::after,.way .read.link-arrow::after,.next-case .go.link-arrow::after{inset:0;z-index:1}
}

/* Short phones (SE-class): keep the case hero inside one screen */
@media (max-width:700px) and (max-height:760px){
  .case-hero{padding-top:84px}
  .case-hero h1{font-size:clamp(21px,6vw,24px)}
  .case-hero .summary{font-size:14.5px;line-height:1.5}
  .meta-strip > div{padding-top:9px}
}
