/* Home page layout. Type, colours and app pieces come from site.css and pieces.css; the home page's own pieces are
   in home-pieces.css. This file only places things.

   Layout rules, from Apple's HIG (Foundations > Layout, and its layout tokens). Every placement below follows them.
   1. Most important first. Order is the same at every width: what playr does (clip names), the mini map, Selects,
      the smaller features, then licenses. The clip-names tile sits top left and is the largest. Text tiles and
      pictures alternate; no two pictures sit side by side or one after another in the single column.
   2. One grid. Everything after the first screen is a tile on one 12 column grid. Tiles span 12, 8, 6, 4 or 3
      columns, never anything else, so edges line up down the page.
   3. Group with containers. One feature is one tile: its title, at most one line, and its piece. The three smaller
      features are one row of tiles (4 columns each), each with a small piece. The licenses are centred page text after the grid.
   4. Consistent spacing. One gap between every tile, the same as the mosaic on the vivin.media work page: 10 px,
      6 px on phones. One padding inside every text tile (24 px). Title to line 8 px, line to piece 24 px.
   5. Square tiles, as on the work page mosaic: no rounded corners, no borders, no shadows. Text tiles are flat
      panels in the surface colour; media tiles are the picture alone. App pieces inside a tile keep the app's own
      look.
   6. One text style per role. Tile titles 21 px semibold, lines 15 px in the soft colour, both left aligned at the
      tile's padding. Lines wrap balanced, never leaving one word alone on the last line, and stop at 44em.
   7. Media fills its tile. Clips and photos cover the tile edge to edge, keep their aspect ratio and are never
      letterboxed or stretched. Each clip or photo appears once on the page.
   8. Adapt by available width, keep everything. 12 columns from 1024 px, 6 + 6 from 640 px, one column below.
      Nothing is hidden at small sizes; side-by-side tiles stack.
   9. Text tiles grow with their text. No text tile has a fixed height, so larger text never clips. A picture beside
      a text tile takes that row's height (at least 240 px) instead of an aspect ratio, so text tiles never stretch.
   10. Controls stand apart from content. Buttons appear once, in the licenses at the end; the filled button is
      View plans. */

/* ---------- header logo: hidden while the big wordmark is on screen (home.js) ---------- */
.home-js .site-header .brand{transition:color .25s ease,opacity .35s var(--ease)}
.home-js:not(.hero-gone) .site-header .brand:not(:focus-visible){opacity:0}
/* On phones the header has two rows. While the big wordmark is on screen its hidden logo row would leave an empty band
   above the nav, so that row folds away and the page starts higher; it slides back once the wordmark has gone. */
@media (max-width:560px){
  .home-js .site-header{transition:color .25s ease,border-color .25s ease,row-gap .35s var(--ease)}
  .home-js .site-header .brand{display:block;max-height:40px;transition:color .25s ease,opacity .35s var(--ease),max-height .35s var(--ease)}
  .home-js:not(.hero-gone) .site-header{row-gap:0}
  .home-js:not(.hero-gone) .site-header .brand:not(:focus-visible){max-height:0;overflow:hidden}
  .home-js.has-nav main{padding-top:calc(var(--header-h) - 61px + env(safe-area-inset-top))}
}

/* ---------- 1. first screen (unchanged) ---------- */
.hero{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;
  min-height:min(calc(92svh - var(--header-h)),820px);padding-block:clamp(8px,2vw,24px) clamp(32px,5vw,64px)}
.wordmark{position:relative;margin:0;
  width:min(100%,1240px,max(280px,(100svh - var(--header-h) - 250px)*2.226));aspect-ratio:2226/1000;
  -webkit-clip-path:url(#wordmark-clip);clip-path:url(#wordmark-clip);
  background:var(--text)}
.wordmark-defs{position:absolute;width:0;height:0;overflow:hidden}
.wordmark video{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:50% 40%;background:transparent}
.hero-line{margin-top:clamp(16px,2.4vw,32px);font-size:clamp(20px,2.2vw,28px);line-height:1.3;letter-spacing:-.01em;max-width:none}
.hero-actions{justify-content:center;margin-top:clamp(24px,3vw,36px)}
.hero-meta{margin-top:12px}
@media (max-width:560px){
  .hero{justify-content:flex-start;min-height:0;padding-top:20px;padding-bottom:0}
}
@media (max-width:480px){.hero-actions{width:100%}}

/* ---------- the grid ---------- */
.bento{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:10px;margin-top:clamp(48px,6vw,96px)}
.tile{grid-column:span 12;min-width:0;margin:0;background:var(--surface);overflow:hidden;padding:24px;
  display:flex;flex-direction:column}
.tile h2{font-size:21px;line-height:1.25;font-weight:600;letter-spacing:-.01em;max-width:none;text-wrap:balance}
.tile h2+p{margin-top:8px;font-size:15px;line-height:1.5;color:var(--soft);max-width:44em;text-wrap:balance}
.tile-art{margin:24px 0 0;flex:1;display:flex;flex-direction:column;justify-content:flex-end;min-width:0}
.tile-art>.app{max-width:none;width:100%}
.t-names .tile-art{justify-content:center}

/* media tiles: no padding, the clip or photo fills the tile */
.t-media{position:relative;padding:0;background:#343b3a;min-height:200px}
.t-media video,.t-media img{position:absolute;inset:0;display:block;width:100%;height:100%;object-fit:cover}

/* the two maps sit side by side inside their tile at the same width, so both are drawn at one scale and their
   chips match */
.maps{margin:24px 0 0;flex-direction:row;gap:48px;justify-content:flex-start;align-items:flex-end}
.maps .glyph{flex:1 1 0;min-width:0}

/* the smaller features: three tiles in one row, each with a small piece */

/* after the grid: the licenses, centred page text, not a tile */
.close{margin-top:var(--space);display:flex;flex-direction:column;align-items:center;text-align:center}
.close h2{font-size:clamp(24px,2.6vw,32px);line-height:1.2;font-weight:600;letter-spacing:-.01em;text-wrap:balance}
.close-price{margin-top:12px;font-size:clamp(17px,1.8vw,21px);line-height:1.45;color:var(--text);max-width:none}
.close-trial{margin-top:8px;color:var(--soft);max-width:none}
.close-actions{margin-top:24px;gap:12px 24px;justify-content:center}
.close-meta{margin-top:16px}

/* ---------- desktop, 1024 px and up: 12 columns ----------
   A checkerboard: no picture touches another across or down.
     names 8      | run clip 4
     TD clip 4    | maps 8
     Selects 8    | goggles clip 4
     ratings 4    | celebration 4 | crew 4
     layup 4      | Premiere 4    | cheer 4 */
@media (min-width:1024px){
  .t-names,.t-maps,.t-flag{grid-column:span 8}
  .t-run,.t-one,.t-goggles,.t-small,.t-celebrate,.t-layup,.t-cheer{grid-column:span 4}
  .t-celebrate,.t-layup,.t-cheer{min-height:240px}
  .t-maps,.t-flag,.t-goggles,.t-small,.t-celebrate,.t-layup,.t-cheer{order:1}
}
/* ---------- tablet, 640 to 1023 px: wide tiles alternating with clips, then text and picture pairs that swap
   sides each row ---------- */
@media (min-width:640px) and (max-width:1023px){
  .bento{gap:10px}
  .t-run,.t-one,.t-goggles{aspect-ratio:16/9}
  .t-small,.t-celebrate,.t-layup,.t-cheer{grid-column:span 6}
  .t-celebrate,.t-layup,.t-cheer{min-height:240px}
  .t-small:not(.t-bin){order:1}.t-celebrate{order:2}.t-layup{order:3}.t-small:not(.t-bin)~.t-small:not(.t-bin){order:4}
  .t-bin{order:5}.t-cheer{order:6}
}
/* ---------- phone, below 640 px: one column ---------- */
@media (max-width:639px){
  .bento{gap:6px;margin-top:40px}
  .t-media{aspect-ratio:3/2}
  .tile{padding:20px}
  .tile-art{margin-top:20px}
  .maps{flex-direction:column;gap:20px}
  .maps .glyph{flex:none;width:100%}
}
