/* Touch screens — Apple's Human Interface Guidelines pass (Steven, 1 Oct:
   "non destructively").

   Everything here is additive and nothing in it can be seen. It only
   applies on touch devices, changes no size, colour, position or type, and
   the whole pass comes out by removing this one file's <link> (build.py
   adds it; fun.html has it by hand).

   What it does:
   1. Bigger places to tap. The guideline is 44pt square. The controls keep
      their size on screen; an invisible area round each one takes the tap.
      Where two controls sit closer together than that allows (the round
      switches in the menu bar), the area stops halfway to its neighbour,
      so one can never steal the other's tap. Those stay under 44pt across
      until the layout itself changes — see HANDOFF, "Touch pass". The film
      tabs under a reel are one of those: 27 tall and 5 apart when they wrap.
   2. No double-tap pause: a tap on a link or button acts at once.
   3. Type keeps its size when the phone is turned on its side.            */

@media (hover:none) and (pointer:coarse){
  html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
  a,button,summary,label,[role="button"]{touch-action:manipulation}

  /* The page only pans up and down (Steven, 1 Oct: it could be moved a little
     left and right). The taped corners, stamps and flaps overhang the sheets
     and a phone let a finger drag the page across to them. This stops the
     sideways drag at the gesture, so nothing is clipped and nothing looks
     different. Pinch-zoom stays, and so do the horizontal swipes inside the
     film reels and the pile of posters, which scroll on their own. */
  html{touch-action:pan-y pinch-zoom}

  /* the round switches in the menu bar: 18px across, 30px for the face */
  .site-header .nav > button,.site-header .fun-dial-btn,[data-sound-slot] .sound-toggle{position:relative}
  .site-header .nav > button::before,[data-sound-slot] .sound-toggle::before{content:"";position:absolute;inset:-13px -5px}
  .site-header .fun-dial-btn::before{content:"";position:absolute;inset:-10px -4px}   /* 44 tall, the height of its row (11 Oct); 32 across, the next control is 9px away */
  [data-sound-slot] .sound-toggle::before{inset:-13px}          /* on its own on the front door: the full 44 */

  /* the menu's words are 44 tall already; the short ones ("CV") get width */
  .site-header .nav > a,.site-header .nav-item > a{position:relative}
  .site-header .nav > a::before,.site-header .nav-item > a::before{content:"";position:absolute;inset:0 -6px}

  /* Email me / Call me / Text me: 33 tall */
  .cta{position:relative}
  .cta::before{content:"";position:absolute;inset:-6px -4px}

  /* the CV's buttons (38 tall) and "What I've done" under the hero (27 tall) */
  .cv-btn,.scroll-cue{position:relative}
  .cv-btn::before{content:"";position:absolute;inset:-3px 0}
  .scroll-cue::before{content:"";position:absolute;inset:-9px 0}

  /* a reel's arrows: 38 to 41 across on a tablet, and on a phone on Zhoosh it up (11 Oct) */
  .reel-arrow::before{content:"";position:absolute;inset:-3px}

  /* the caption pills, Sound on and Pause: 32 tall, and 10 apart when they stack on a phone (11 Oct) */
  .hear{position:relative}
  .hear::before{content:"";position:absolute;inset:-5px 0}
}


/* ---- on trial: ?try=edge and ?try=text (trial.js). Off unless asked for. ---- */

/* Edge to edge. The viewport covers the whole screen, so the wall (which is
   fixed to it) runs under the notch and the home bar; the page itself keeps
   clear of them. In portrait in Safari there's nothing to clear; it shows in
   landscape and when the site is opened from the home screen. */
html.try-edge body{padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)}
html.try-edge .lay-stack .site-header.sheet.pinned{top:env(safe-area-inset-top);
  width:min(1140px,calc(100vw - 2 * max(4vw,env(safe-area-inset-left),env(safe-area-inset-right))))}
html.try-edge body:not(.lay-stack) .site-header{top:env(safe-area-inset-top)}

/* Text size. On an iPhone this makes the page's base size the one set in
   Settings > Display & Text Size, so every size given in rem grows or
   shrinks with it. At the standard setting the base is 17px, not 16px. */
@supports (font:-apple-system-body){
  html.try-text{font:-apple-system-body}
}
