/* The wall view of /live (live/wall.js): every Crew on one screen, read from a few metres.
   The site's paper and ink; every size follows the screen, so a TV and a laptop show the same wall. */
html.wl-lock, html.wl-lock body { overflow: hidden; }
.wl[hidden] { display: none !important; }

.wl {
    --card: #FDFCF9;
    position: fixed; inset: 0; z-index: 2000;
    width: 100vw; height: 100vh; height: 100dvh;
    box-sizing: border-box;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    gap: 1.1em;
    padding: 2em 3em 1.3em;
    overflow: hidden;
    background: var(--paper);
    color: var(--ink);
    font: min(1.04vw, 1.85vh)/1.4 var(--serif);
    outline: none;
}
.wl.wl-scaled { grid-template-rows: auto auto minmax(0, 1fr) auto auto; }
.wl:not(.wl-awake) { cursor: none; }
.wl p { margin: 0; }
.wl-k { font: .6em/1.3 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

/* The top band: the wordmark, the line, the clock. */
.wl-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "mark clock" "aha clock";
    column-gap: 3em; row-gap: .9em;
    align-items: end;
    padding-bottom: 1.1em;
    border-bottom: 1px solid var(--ink);
}
.wl-mark { grid-area: mark; display: block; height: 1.9em; width: auto; }
.wl-aha { grid-area: aha; font-size: 3.2em; font-weight: normal; line-height: 1.04; margin: 0; letter-spacing: -.005em; }
.wl-clock { grid-area: clock; text-align: right; min-width: 9em; }
.wl-time { font-size: 4.9em; line-height: .88; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.wl-minute { display: block; height: 2px; background: var(--rule); margin: .55em 0 .5em; }
.wl-minute > span { display: block; height: 100%; width: 0; background: var(--ink); transition: width 1s linear; }
.wl-date { font: .82em/1.3 var(--sans); color: var(--muted); }

.wl-scale { font: .74em/1.4 var(--sans); border: 1px dashed var(--ink); padding: .45em .7em; justify-self: start; }

/* The Crews and the one in focus. */
.wl-body { display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 1.2em; min-height: 0; }
.wl-grid {
    display: grid;
    grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr));
    grid-template-rows: repeat(var(--rows, 1), minmax(0, 1fr));
    gap: 1.1em;
    min-height: 0;
}
.wl-tile {
    position: relative;
    display: flex; flex-direction: column; gap: .65em;
    min-width: 0; min-height: 0; overflow: hidden;
    padding: 1.1em 1.3em 1em;
    background: var(--card);
    border: 1px solid var(--rule);
    transition: border-color .5s ease, box-shadow .5s ease;
}
.wl-tile.wl-on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }

.wl-thead { display: flex; align-items: center; gap: .7em; min-width: 0; }
.wl-name { flex: 1 1 auto; min-width: 0; font-size: 1.75em; font-weight: normal; line-height: 1.1; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wl-badge { flex: none; font: .58em/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; padding: .4em .55em; border: 1px solid var(--ink); white-space: nowrap; }
.wl-live { background: var(--ink); color: var(--paper); }
.wl-build { border-style: dashed; }
.wl-dot { flex: none; width: .55em; height: .55em; border-radius: 50%; background: var(--ink); opacity: .16; }
.wl-beat { animation: wl-beat 1.3s ease-out; }
@keyframes wl-beat { 0% { opacity: .9; transform: scale(1.6); } 100% { opacity: .16; transform: scale(1); } }
.wl-sub { display: flex; align-items: center; gap: .7em; min-width: 0; margin-top: -.25em !important; }
.wl-subt { font: .66em/1.3 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.wl-act { display: flex; flex-direction: column; gap: .2em; }
.wl-spark { display: block; width: 100%; height: 3em; }
.wl-spark-area { fill: rgba(20, 20, 20, .07); }
.wl-spark-line { stroke: var(--ink); stroke-width: 1.4; vector-effect: non-scaling-stroke; }
.wl-spark-now { stroke: var(--faint); stroke-width: 1; stroke-dasharray: 2 3; vector-effect: non-scaling-stroke; }
.wl-spark-dot { fill: var(--ink); }
.wl-ticks { display: flex; justify-content: space-between; font: .58em/1 var(--sans); color: var(--faint); font-variant-numeric: tabular-nums; }

.wl-nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .9em; border-top: 1px solid var(--rule); padding-top: .65em; }
.wl-n { min-width: 0; }
.wl-n .wl-k { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wl[data-rows="2"] .wl-n .wl-k, .wl[data-rows="3"] .wl-n .wl-k { letter-spacing: .06em; font-size: .54em; }
.wl-v { font-size: 2em; line-height: 1.05; margin-top: .15em !important; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wl-bar { display: block; height: 2px; background: var(--rule); margin-top: .45em; }
.wl-bar > span { display: block; height: 100%; background: var(--ink); }
.wl-barrow { display: flex; align-items: center; gap: .55em; margin-top: .45em; }
.wl-barrow .wl-bar { flex: 1 1 auto; margin-top: 0; }
.wl-flag { flex: none; font: .56em/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--ink); white-space: nowrap; }
.wl-flag::before { content: ""; display: inline-block; width: .55em; height: .55em; border: 1px solid var(--ink); border-radius: 50%; margin-right: .35em; vertical-align: -.02em; }

.wl-latest { border-top: 1px solid var(--rule); padding-top: .55em; min-height: 0; }
.wl-items { list-style: none; margin: .35em 0 0; padding: 0; font: .8em/1.4 var(--sans); color: var(--body); transition: opacity .4s ease; }
.wl-items li { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wl-fade { opacity: 0; }

/* More Crews, smaller tiles: the latest hour leaves the tile (the strip and the dots carry it). */
.wl[data-rows="2"] .wl-aha, .wl[data-rows="3"] .wl-aha { font-size: 2.6em; }
.wl[data-rows="2"] .wl-time, .wl[data-rows="3"] .wl-time { font-size: 4em; }
.wl[data-rows="2"] .wl-latest, .wl[data-rows="3"] .wl-latest { display: none; }
.wl[data-rows="2"] .wl-v, .wl[data-rows="3"] .wl-v { font-size: 1.7em; }
.wl[data-rows="2"] .wl-tile { font-size: .84em; gap: .55em; padding: .9em 1.1em .85em; }
.wl[data-rows="2"] .wl-spark { height: 2.4em; }
.wl[data-rows="3"] .wl-tile { font-size: .72em; gap: .45em; padding: .7em .9em .65em; }
.wl[data-rows="3"] .wl-spark { height: 1.5em; }
.wl[data-rows="3"] .wl-ticks { display: none; }
.wl[data-rows="3"] .wl-nums { padding-top: .45em; }
.wl[data-rows="3"] .wl-flag { display: none; }
.wl[data-rows="3"] .wl-role { font-size: .9em; }

.wl-spot {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) repeat(3, minmax(0, 1fr));
    gap: 2.2em;
    height: 9em;
    overflow: hidden;
    padding-top: .9em;
    border-top: 1px solid var(--ink);
    transition: opacity .4s ease;
}
.wl[data-rows="2"] .wl-spot { height: 7.6em; }
.wl[data-rows="3"] .wl-spot { height: 6.4em; }
/* Four Crews or more: the strip below carries each one's 24 hours, so the tiles drop their line. */
.wl[data-rows="2"] .wl-act, .wl[data-rows="3"] .wl-act { display: none; }
.wl[data-rows="2"] .wl-role, .wl[data-rows="3"] .wl-role { font-size: .76em; -webkit-line-clamp: 3; }
.wl[data-rows="2"] .wl-figtot .wl-totgrid { margin-top: .5em; }
.wl[data-rows="2"] .wl-totgrid .wl-outv { font-size: 1.9em; }
.wl[data-rows="3"] .wl-who-name { font-size: 1.4em; }
.wl[data-rows="3"] .wl-spot { height: 4.8em; }
.wl[data-rows="3"] .wl-role { display: none; }
.wl[data-rows="3"] .wl-totgrid .wl-outv, .wl[data-rows="3"] .wl-outv { font-size: 1.6em; }
.wl[data-rows="3"] .wl-figtot .wl-totgrid { margin-top: .5em; }
.wl[data-rows="3"] .wl-stitle { display: none; }
.wl[data-rows="3"] .wl-scells, .wl[data-rows="3"] .wl-saxis { gap: 1px; }
.wl[data-rows="3"] .wl-sgrid { row-gap: 1px; }
.wl[data-rows="3"] .wl-name { font-size: 1.45em; }
.wl[data-rows="3"] .wl-v { font-size: 1.45em; }
.wl-spot.wl-fade { opacity: 0; }
.wl-who { min-width: 0; }
.wl-who-name { font-size: 1.7em; line-height: 1.1; margin: .2em 0 .35em !important; }
.wl-role { font-size: .8em; line-height: 1.38; color: var(--body); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.wl-spot-plain { grid-template-columns: minmax(0, 1.15fr) minmax(0, 3fr); }
.wl-figtot { display: block; }
.wl-figtot .wl-totgrid { margin-top: 1em; }
.wl-totgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.6em; align-self: end; }
.wl-totgrid .wl-outv { font-size: 2.4em; }
.wl-totgrid .wl-outk { font-size: .62em; min-height: 0; }

.wl-fig { margin: 0; min-width: 0; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: .45em; }
.wl-chart { display: block; width: 100%; height: 100%; min-height: 0; overflow: visible; }
.wl-barr { fill: #d6d1c7; }
.wl-barr-last { fill: var(--ink); }
.wl-axis { stroke: var(--rule); stroke-width: 1; }
.wl-chart-v { font: 13px var(--sans); fill: var(--ink); }
.wl-chart-k { font: 11px var(--sans); fill: var(--muted); }
.wl-pipe-a { stroke: var(--ink); stroke-width: 2.2; }
.wl-pipe-b { stroke: var(--faint); stroke-width: 2.2; }
.wl-legend { display: flex; gap: 1.2em; font: .62em/1.2 var(--sans); color: var(--muted); }
.wl-legend span::before { content: ""; display: inline-block; width: 1.4em; height: 2px; vertical-align: .3em; margin-right: .45em; }
.wl-lg-a::before { background: var(--ink); }
.wl-lg-b::before { background: var(--faint); }
.wl-outgrid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .7em; align-self: end; }
.wl-outv { font-size: 1.9em; line-height: 1; font-variant-numeric: tabular-nums; }
.wl-outk { font: .56em/1.25 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-top: .35em !important; min-height: 2.5em; }

/* The last 24 hours: one row per Crew of the page, one square per hour, the minute marked. */
.wl-strip { position: relative; border-top: 1px solid var(--ink); padding-top: .7em; }
.wl-stitle { margin-bottom: .5em !important; }
.wl-sgrid { display: grid; grid-template-columns: 12em minmax(0, 1fr); column-gap: 1.1em; row-gap: 2px; align-items: center; }
.wl-slab { font: .6em/1.2 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wl-scells { display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); gap: 2px; height: clamp(.42em, calc(4.4em / var(--n, 3)), 1.2em); }
.wl-sq { display: block; min-width: 0; }
.wl-sq-0 { box-shadow: inset 0 0 0 1px var(--rule); }
.wl-saxis { display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); gap: 2px; height: 1.15em; align-items: end; }
.wl-stick { font: .58em/1 var(--sans); color: var(--faint); font-variant-numeric: tabular-nums; white-space: nowrap; }
.wl-stick-now { text-align: right; color: var(--ink); letter-spacing: .08em; text-transform: uppercase; }
.wl-snow { position: absolute; width: 2px; margin-left: -1px; background: var(--ink); pointer-events: none; }

.wl-foot { display: flex; justify-content: space-between; align-items: baseline; gap: 2em; margin: 0; padding: 0; border: 0; }
.wl-dating, .wl-page { font: .72em/1.4 var(--sans); color: var(--muted); }
.wl-page { white-space: nowrap; }

/* Controls, shown while the mouse moves. */
.wl-ctl { position: absolute; right: 3em; bottom: 4.6em; display: flex; gap: .5em; opacity: 0; pointer-events: none; transition: opacity .3s ease; }
.wl-awake .wl-ctl, .wl-ctl:focus-within { opacity: 1; pointer-events: auto; }
.wl-btn { font: .72em/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; padding: .8em 1.1em; min-height: 40px; background: var(--paper); color: var(--ink); border: 1px solid var(--ink); cursor: pointer; }
.wl-exit { background: var(--ink); color: var(--paper); }
.wl-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.wl-still *, .wl-still { transition: none !important; }
.wl-still .wl-beat { animation: none; }

/* A phone: the wall becomes a column the reader scrolls. */
@media (max-width: 700px) {
    .wl { display: block; font-size: 15px; padding: 1.1em 1em 1.4em; overflow-y: auto; -webkit-overflow-scrolling: touch; cursor: auto; }
    .wl > * + * { margin-top: 1em; }
    .wl-top { grid-template-columns: minmax(0, 1fr); grid-template-areas: "mark" "aha" "clock"; row-gap: .7em; }
    .wl-clock { text-align: left; min-width: 0; }
    .wl-time { font-size: 3em; }
    .wl-aha { font-size: 1.75em; }
    .wl-body { display: block; }
    .wl-grid { grid-template-columns: minmax(0, 1fr) !important; grid-template-rows: none !important; }
    .wl .wl-tile { font-size: 1em; gap: .7em; padding: 1em; }
    .wl .wl-spark { height: 3.2em; }
    .wl .wl-nums { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: .8em; }
    .wl .wl-v { font-size: 1.7em; }
    .wl .wl-ticks { display: flex; }
    .wl .wl-act { display: flex; }
    .wl .wl-spot { overflow: visible; }
    .wl .wl-role { -webkit-line-clamp: unset; display: block; }
    .wl .wl-items li:nth-child(n) { display: list-item; white-space: normal; }
    .wl .wl-spot { display: grid; grid-template-columns: minmax(0, 1fr); height: auto; margin-top: 1.2em; gap: 1.2em; }
    .wl-chart { height: 8em; }
    .wl-outgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .wl-totgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .wl-sgrid { grid-template-columns: 6.5em minmax(0, 1fr); column-gap: .6em; }
    .wl-scells, .wl-saxis { gap: 1px; }
    .wl-scells { height: 1.2em; }
    .wl-foot { display: block; }
    .wl-page { margin-top: .4em !important; }
    .wl-ctl { position: sticky; bottom: .6em; right: auto; justify-content: flex-end; opacity: 1; pointer-events: auto; margin-top: 1em; }
}
@media (prefers-reduced-motion: reduce) {
    .wl *, .wl { transition: none !important; animation: none !important; }
}
