/* Touch and phone layer.
   Hover effects in style.css only run on devices that can hover (@media (hover:hover)), so nothing "sticks" after a tap.
   Here: press feedback for touch, and the scroll-driven "live" states (set by main.js) that stand in for hover on phones. */

/* ---------- press feedback (touch screens) ---------- */
@media (hover:none){
  a,button{-webkit-tap-highlight-color:transparent;touch-action:manipulation}
  .btn:active::before{transform:none;transition-duration:.18s}
  .btn:active{color:var(--navy)}
  .band .btn:active{color:var(--navy)}
  .btn-gold:active{transform:scale(.97);box-shadow:0 10px 22px -12px rgba(200,160,70,.55)}
  .fixed-cta:active{background:var(--gold);color:var(--navy)}
  .fixed-cta.on-dark:active{background:var(--ivory)}
  .wa:active{scale:.94}
  .totop:active{background:var(--gold);border-color:var(--gold);color:var(--navy)}
  .menu .chip:active{background:var(--gold);border-color:var(--gold);color:var(--navy)}
  .menu .mcta:active{background:var(--ivory)}
  .tm .ctrl button:active{background:var(--navy);color:var(--ivory)}
  .foot .cols a:active{color:var(--gold)}
  .hx-link:active{border-color:var(--gold)}
  .wcard:active .wimg img{transform:scale(1.05);transition-duration:.25s}
  .irow:active .t{transform:translateX(10px);color:var(--gold)}
}

/* ---------- phones and tablets: scroll-driven states that replace hover ---------- */
@media (max-width:900px),(hover:none){
  /* work cards: the card in the middle of the screen comes alive (image eases in, shade lifts) */
  .wcard.is-live .wimg img{transform:scale(1.04)}
  .wcard.is-live .wimg::after{background:rgba(6,31,44,.06)}

  /* all-projects list: the centred row slides gold */
  .irow.is-live .t{transform:translateX(10px);color:var(--gold)}
}
/* phones: each project row shows its own small preview (the floating cursor preview is desktop-only) */
.irow .mthumb{display:none}
@media (max-width:900px){
  .irow{grid-template-columns:auto 1fr 76px;align-items:center}
  .irow .mthumb{display:block;width:76px;aspect-ratio:4/3;border-radius:4px;overflow:hidden;background:var(--navy-medium);opacity:.55;transform:scale(.94);transition:opacity .5s var(--ease),transform .6s var(--ease)}
  .irow .mthumb img{width:100%;height:100%;object-fit:cover;object-position:top;display:block}
  .irow.is-live .mthumb{opacity:1;transform:none}
}

/* process steps: on phones the navy "slider" can't travel between cells, so the cell in view fills navy itself */
@media (max-width:900px){
  .sgrid .cell{transition:background-color .6s var(--ease)}
  .sgrid .cell.is-on{background:var(--navy)}
}

/* menu on phones: the outer orbit (Contact) was as wide as the screen, so its chip drifted off the edge.
   Size the orbit system so every chip's full width stays on screen, and give chips a 44px-tall tap area. */
@media (max-width:900px){
  .menu .morbits{--os:min(66vw,52vh)}
  .menu .chip::after{content:"";position:absolute;inset:-7px -6px}
  /* the chips start 90deg apart; with mixed directions and speeds they cross each other on a narrow screen.
     On phones all four travel the same way at the same pace, so they keep that spacing and never overlap. */
  .menu .rh{animation-name:orbit-cw!important;animation-duration:48s!important}
  .menu .cw{animation-name:counter-cw!important;animation-duration:48s!important}
}
@media (hover:none){
  /* a finger on a chip holds its orbit still */
  .menu .mring:has(.chip:active) .rh,.menu .mring:has(.chip:active) .cw{animation-play-state:paused!important}
}


/* phones: section headings with an inline grid-column (Process, Kind words) were pushed into a phantom 2nd column and ran off screen */
@media (max-width:900px){
  .steps .hd>div,.tm .hd>div{grid-column:auto!important}
  .steps .hd>div+div,.tm .hd>div+div{margin-top:18px}
}
/* touch: small text links get a 44px-tall tap area without changing the layout */
@media (hover:none){
  .link{display:inline-block;padding-top:12px;padding-bottom:12px;margin-top:-12px;margin-bottom:-9px}
  .link::after{bottom:9px}
  .foot .cols a{display:inline-block;padding-block:12px;margin-block:-12px}
}
