/* Shared by every page, Home included. The two exported trees, and the page change as a power cycle. */
@view-transition { navigation: auto; }

*, ::before, ::after { box-sizing: border-box; }
html { scrollbar-width: none; background: #0A0E0D; }
html::-webkit-scrollbar { display: none; }
body { margin: 0; background: #0A0E0D; }

/* CSS selects one tree before paint, including when page scripts cannot run. */
.tree-d { zoom: var(--zd, 1); display: none; }
.tree-m { zoom: var(--zm, 1); }
@media (min-width: 900px) {
  .tree-d { display: block; }
  .tree-m { display: none; }
}
/* LAND-0: keep the phone frame and its viewport-fixed chrome in the same capped column. */
@media (min-width: 430.02px) and (max-width: 899.98px) {
  html.is-m .tree-m { width: 390px; margin-inline: auto; }
  html.is-m .tree-m .cw-topbar { left: var(--mx) !important; }
  html.is-m .tree-m [data-pencil-name="V3 / M / Dock"] { left: calc(var(--mx) + 16px) !important; }
  html.is-m #cw-guide { padding-inline: calc((100vw - 430px) / 2 + 20px); }
}
/* the page frames clip; clip instead of hidden so the sticky nav still sticks */
.tree > div { overflow: clip !important; }

/* ---------- the power cycle (T1, T2, T6, T7) ---------- */
/* The live opening squash must not become a native history-restoration anchor. */
html.cw-cutting { overflow-anchor: none; }
::view-transition { background: #0A0E0D; }
::view-transition-group(root) { animation: none; }
::view-transition-old(root),
::view-transition-new(root) { animation: none; transform-origin: 50% var(--cut-y, 50vh); }

/* the lime line and the pixel live on the new page so they are not squashed with it */
#cw-line, #cw-px { position: fixed; display: none; pointer-events: none; z-index: 2147483000; }
#cw-line { left: 0; right: 0; height: 2px; top: calc(var(--cut-y, 50vh) - 1px); background: #C5FF1A; box-shadow: 0 0 14px 1px #C5FF1AB3, 0 0 48px 4px #C5FF1A4D; view-transition-name: cw-line; }
#cw-px { background: #C5FF1A; box-shadow: 0 0 22px #C5FF1AAA; view-transition-name: cw-px; }
html.cw-cutting #cw-line, html.cw-cutting #cw-px { display: block; }
html.cw-nopx #cw-px { display: none !important; }
::view-transition-group(cw-line), ::view-transition-group(cw-px),
::view-transition-new(cw-line), ::view-transition-new(cw-px),
::view-transition-group(cw-onair), ::view-transition-new(cw-onair), ::view-transition-old(cw-onair) { animation: none; }

/* ---------- Next Channel (T3): the tapped set grows into the case's tuned hero; the nav holds still ---------- */
::view-transition-group(cw-set) { animation-duration: 440ms; animation-timing-function: cubic-bezier(.65, 0, .35, 1); }
::view-transition-old(cw-set), ::view-transition-new(cw-set) { animation-duration: 440ms; height: 100%; object-fit: cover; }
::view-transition-group(cw-nav0), ::view-transition-group(cw-nav1),
::view-transition-old(cw-nav0), ::view-transition-new(cw-nav0),
::view-transition-old(cw-nav1), ::view-transition-new(cw-nav1) { animation-duration: 440ms; }

/* reduced motion: a 90 ms crossfade in place of every cut */
html.rm::view-transition-old(root), html.rm::view-transition-new(root) { transform: none; }
