/* playisvik.com: the departure board on Isvik's quay. Colours are the game's palette (assets/palette.json),
   Micro5 sits on whole font pixels (font-size 11N px = N px a font pixel), and art sits on whole device pixels. */
@font-face{font-family:Micro5;src:url(/fonts/Micro5-Regular.woff2) format("woff2");font-display:swap}
:root{
  --ink:#161a2c;--night:#124a56;--deep:#1a6470;--slate:#4e6470;--lilac:#8c98bc;--ice:#eae6f0;--snow:#fffcfa;
  --gold:#fbd566;--amber:#e07c1c;--frost:#4ea8f0;--green:#4eaa64;
  --u:1px;          /* CSS px per art px: a whole number of device px on 1x, 2x and 3x screens */
  --led:16px;       /* the wordmark's LED pitch (a multiple of 4, so LED and gap are whole px) */
  --gut:16px;
  --c:calc(2 * var(--u)); /* a frame: 2 art px */
  --v:1px;          /* the trailer box: 480 art rows of it */
  color-scheme:dark;
}
@media (min-resolution:2dppx){:root{--u:1.5px}}
@media (min-resolution:3dppx){:root{--u:calc(4px / 3)}}
@media (min-resolution:2dppx) and (min-height:900px){:root{--v:1.5px}}
@media (min-width:60rem){:root{--led:28px;--gut:32px}}

*{box-sizing:border-box}
html{background:var(--ink);color:var(--ice);font:18px/1.6 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;-webkit-text-size-adjust:100%;scrollbar-color:var(--slate) var(--ink)}
body{margin:0;display:flex;flex-direction:column;min-height:100svh;background:var(--ink) url(/img/art/sky.png) 0 0/calc(144 * var(--u)) repeat;image-rendering:pixelated}
::selection{background:var(--gold);color:var(--ink)}
img,video{display:block;max-width:100%;height:auto}
.art{image-rendering:pixelated}
a{color:var(--gold);text-decoration-thickness:2px;text-underline-offset:.2em}
a:hover{text-decoration-thickness:4px}
:focus-visible{outline:3px solid var(--snow);outline-offset:3px}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.skip{width:auto;position:absolute;left:var(--gut);top:-4rem;z-index:2;padding:.5rem 1rem;background:var(--gold);color:var(--ink);font:22px/1 Micro5,monospace}
.skip:focus{top:.5rem}
.skip:hover{background:var(--amber)}

/* Micro5 at whole font pixels; no letter-spacing, no weights */
h1,h2,h3,.px,.bar,.cells,.key,.rows button,.sheet dt,summary,.state,.mark{font-family:Micro5,ui-monospace,monospace;font-weight:400;letter-spacing:0;-webkit-font-smoothing:none}
h1{font-size:44px;line-height:44px;color:var(--snow);margin:0 0 24px}
h2{font-size:44px;line-height:44px;color:var(--snow);margin:0}
h3{font-size:33px;line-height:33px;color:var(--gold);margin:40px 0 8px}
@media (min-width:60rem){h1{font-size:66px;line-height:66px}.bar nav a{font-size:33px;line-height:33px;padding:6px 0}.bar nav{gap:32px}}
p,li,dd{max-width:65ch}

.wrap{max-width:72rem;margin:0 auto;padding-inline:var(--gut)}

/* the title bar */
.bar{display:flex;justify-content:space-between;align-items:center;gap:8px 24px;flex-wrap:wrap;padding-block:20px}
.bar a{text-decoration:none;font-size:22px;line-height:22px;padding:11px 0}
.mark{color:var(--snow);font-size:33px!important;line-height:33px!important}
.bar nav{display:flex;gap:20px}
.bar nav a[aria-current]{color:var(--snow);text-decoration:underline;text-decoration-thickness:2px;text-underline-offset:6px}

/* the board: an ink face in a 2 art px slate frame with its corners cut */
.board{--bp:16px;background:var(--ink);border:var(--c) solid var(--slate);padding:24px var(--bp);margin-bottom:32px;clip-path:polygon(var(--c) 0,calc(100% - var(--c)) 0,calc(100% - var(--c)) var(--c),100% var(--c),100% calc(100% - var(--c)),calc(100% - var(--c)) calc(100% - var(--c)),calc(100% - var(--c)) 100%,var(--c) 100%,var(--c) calc(100% - var(--c)),0 calc(100% - var(--c)),0 var(--c),var(--c) var(--c))}
.board > section + section{margin:28px calc(-1 * var(--bp)) 0;padding:28px var(--bp) 0;border-top:var(--c) solid var(--slate)}
@media (min-width:60rem){.board{--bp:48px;padding:40px var(--bp);margin-bottom:48px}.board > section + section{margin-top:44px;padding-top:44px}}
.row-head{padding-bottom:20px;border-bottom:calc(2 * var(--u)) solid var(--night)}

/* hero: LED strip, cells, the display, the pitch */
.hero{display:grid;gap:16px;grid-template-areas:"led" "tag" "cells" "keys" "display" "lede" "fine"}
.led{grid-area:led;margin:0;padding:var(--led);width:calc(19 * var(--led));max-width:100%;height:calc(7 * var(--led));
  background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 4'%3E%3Crect x='1' y='1' width='1' height='1' fill='%23124a56'/%3E%3C/svg%3E") 0 0/var(--led) var(--led)}
.word{display:block;width:calc(14.75 * var(--led));height:calc(4.75 * var(--led));fill:var(--gold);shape-rendering:crispEdges}
.tagline{grid-area:tag;margin:0;font-size:33px;line-height:33px;color:var(--snow)}
.cells{grid-area:cells;display:flex;margin:0}
.cells div{padding-right:12px;margin-right:12px;border-right:var(--c) solid var(--night)}
.cells div:last-child{border:0;margin:0;padding:0}
.cells dt{font-size:22px;line-height:22px;color:var(--lilac)}
.cells dd{margin:6px 0 0;font-size:22px;line-height:22px;color:var(--gold)}
.display{grid-area:display;margin:0;justify-self:center}
/* on a 3x phone the box is 886 device px wide: one video px per device px */
.display{display:flex;flex-direction:column;align-items:center;gap:10px}
.screen{position:relative;width:min(calc(221.5 * var(--u)),100%);aspect-ratio:886/1920;border:var(--c) solid var(--slate);background:var(--night);box-sizing:content-box}
.screen > *{position:absolute;inset:0;width:100%;height:100%}
.screen video{object-fit:cover;image-rendering:pixelated}
.vkeys{display:flex;gap:8px;justify-content:center}
.lede{font-size:20px;line-height:1.5;color:var(--snow);margin:0}
.hero .lede{grid-area:lede}
.hero .fine{grid-area:fine}
.keys{display:flex;flex-wrap:wrap;align-items:center;gap:12px 24px}
.hero .keys{grid-area:keys}
.cell-note{margin:0;font:22px/22px Micro5,monospace;-webkit-font-smoothing:none;color:var(--snow)}
.dim{color:var(--lilac)}
.fine{color:var(--lilac);font-size:16px;margin:0}
@media (min-width:60rem){
  .hero{grid-template-columns:1fr auto;grid-template-rows:auto auto auto auto auto auto 1fr;column-gap:56px;row-gap:28px;grid-template-areas:"led display" "tag display" "cells display" "lede display" "keys display" "fine display" ". display"}
  .cells div{padding-right:28px;margin-right:28px}
  .cells div:last-child{padding:0;margin:0}
  .hero > *{min-width:0}
  .tagline{font-size:44px;line-height:44px}
  .cells dd{font-size:44px;line-height:44px}
  .display{grid-row:1 / span 7;align-self:start}
  .screen{width:auto;height:calc(480 * var(--v))}
  .lede{font-size:22px}
}

/* keys: lit board buttons */
.key{display:inline-flex;align-items:center;gap:10px;min-height:48px;padding:0 18px;border:0;background:var(--gold);color:var(--ink);font-size:22px;line-height:22px;text-decoration:none;cursor:pointer;clip-path:polygon(var(--c) 0,calc(100% - var(--c)) 0,calc(100% - var(--c)) var(--c),100% var(--c),100% calc(100% - var(--c)),calc(100% - var(--c)) calc(100% - var(--c)),calc(100% - var(--c)) 100%,var(--c) 100%,var(--c) calc(100% - var(--c)),0 calc(100% - var(--c)),0 var(--c),var(--c) var(--c))}
@media (min-width:60rem){.key{font-size:33px;line-height:33px}}
.key:hover{background:var(--amber);color:var(--ink)}
.key:focus-visible{outline:none;background:var(--snow);box-shadow:inset 0 0 0 3px var(--ink)}
.key.small{min-height:44px;padding:0 14px;font-size:22px!important;line-height:22px!important;background:var(--ink);color:var(--gold);box-shadow:inset 0 0 0 var(--c) var(--slate)}
.key.small:hover{color:var(--amber)}
.key.small:focus-visible{background:var(--ink);color:var(--snow);box-shadow:inset 0 0 0 3px var(--snow)}
.key svg{width:calc(7 * 2px);height:14px;fill:currentColor;shape-rendering:crispEdges}
.key.sound svg{width:18px}
.key .i-play,.key .i-on{display:none}
.key[data-state=paused] .i-play,.key[data-state=on] .i-on{display:inline}
.key[data-state=paused] .i-pause,.key[data-state=on] .i-off{display:none}

/* How it plays: every row on the board, one lit at a time with its frame on the display */
.route{display:grid;gap:24px;margin-top:8px}
.rows{display:grid;order:2}
.rows button{display:grid;grid-template-columns:1fr auto;align-items:center;gap:4px 16px;min-height:56px;padding:12px;margin:0;border:0;border-bottom:calc(2 * var(--u)) solid var(--night);background:none;color:var(--lilac);font-size:33px;line-height:33px;text-align:left;cursor:pointer}
.rows .name::before{content:"";display:inline-block;width:8px;height:8px;margin-right:14px;vertical-align:middle;background:var(--night)}
.rows button:hover{color:var(--amber)}
.rows button:focus-visible{outline-offset:-3px}
.rows .state{font-size:22px;line-height:22px;color:var(--lilac)}
.rows .desc{grid-column:1 / -1;font:17px/1.55 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;-webkit-font-smoothing:auto;color:var(--ice);max-width:52ch;padding-top:8px}
.js .rows [aria-selected=false] .desc{display:none;color:var(--lilac)}
.rows [aria-selected=true]{color:var(--gold)}
.rows [aria-selected=true] .name::before{background:var(--gold)}
.rows [aria-selected=true] .state{color:var(--gold)}
.rows [aria-selected=true] .gold{color:var(--gold)}
.rows [aria-selected=true] .frost{color:var(--frost)}
.rows [aria-selected=true] .amber{color:var(--amber)}
.rows [aria-selected=true] .green{color:var(--green)}
.panel{order:1;justify-self:center}
.frame{width:220px;max-width:none;border:var(--c) solid var(--slate);box-sizing:content-box}
@media (min-width:60rem){.frame{width:calc(220 * var(--u))}}
@media (min-width:60rem){
  .route{grid-template-columns:minmax(0,1fr) auto;column-gap:56px;align-items:start}
  .rows{order:0;grid-column:1;grid-row:1 / span 5}
  .js .rows{grid-row:1}
  .panel{grid-column:2;justify-self:end}
  .js .panel{grid-row:1}
  .js .rows [aria-selected=false] .desc{display:block}
  .rows button{padding:16px}
  .js .panel[hidden]{display:none}
}

/* Fare and facts: a timetable of rows */
.sheet{margin:0}
.sheet div{display:grid;grid-template-columns:1fr;gap:4px 24px;padding:14px 0;border-bottom:calc(2 * var(--u)) solid var(--night)}
.sheet dt{font-size:22px;line-height:22px;color:var(--lilac);padding-top:4px}
.sheet dd{margin:0;color:var(--snow)}
@media (min-width:40rem){.sheet div{grid-template-columns:9rem 1fr}}

/* the close: the lighthouse row, its line and the key again */
.lamp-row{display:flex;justify-content:space-between;align-items:center;gap:16px;margin:0 0 24px;padding-bottom:20px;max-width:none;border-bottom:calc(2 * var(--u)) solid var(--night)}
.close .keys{margin:0}
.close .lede,.page .lede{margin:0 0 24px}
.px-link{font:33px/33px Micro5,monospace;-webkit-font-smoothing:none}
.lamp-row .px{font-size:33px;line-height:33px;color:var(--snow)}
.flip{font-size:33px;line-height:33px;color:var(--lilac)}
.flip.on{color:var(--gold)}

/* the close: footer on the night, then the coast under the band's foot */
.end{margin-top:auto;padding-top:56px}
body > *{width:100%}
.foot{padding-bottom:28px;color:var(--snow)}
.foot nav{display:flex;flex-wrap:wrap;gap:4px 18px;margin-bottom:8px}
.foot nav a{font:22px/44px Micro5,monospace;-webkit-font-smoothing:none}
.foot p{margin:0;font-size:16px}
.coast{display:flex;justify-content:flex-end;overflow:hidden;
  background:url(/img/art/foot.png) right 0 top 0/calc(4 * var(--u)) calc(3 * var(--u)) repeat-x,url(/img/art/sea.png) right calc(34 * var(--u)) top calc(15 * var(--u))/calc(48 * var(--u)) repeat var(--deep)}
.coast img{width:calc(504 * var(--u));max-width:none;height:calc(183 * var(--u));image-rendering:pixelated;flex:none}

/* reading pages: one board, its rows ruled */
.page{padding-top:32px}
.page h2{margin-top:56px;padding-bottom:14px;border-bottom:calc(2 * var(--u)) solid var(--night)}
.page h2 + *{margin-top:20px}
.page ul{padding-left:1.2em}
.page li{margin:.35em 0}
.page li::marker{color:var(--gold)}
.page .sheet{margin-top:8px}
.status{display:flex;flex-wrap:wrap;gap:4px 14px;align-items:baseline;margin:0 0 24px;font:22px/22px Micro5,monospace;-webkit-font-smoothing:none}
.status b{font:33px/33px Micro5,monospace;font-weight:400}
.go{color:var(--green)}
.frozen{color:var(--frost)}
.meta,time{color:var(--lilac)}
.page .screen{margin:8px 0 16px}
.shots{list-style:none;padding:0;margin:16px 0 0;display:flex;gap:16px;overflow-x:auto;scroll-snap-type:x mandatory;padding-bottom:12px}
.shots li{flex:none;margin:0;scroll-snap-align:start}
.shots img{width:220px;max-width:none;height:auto;border:calc(2 * var(--u)) solid var(--slate)}
.shots a:hover img,.shots a:focus-visible img{border-color:var(--gold)}
@media (min-width:60rem){.shots{display:grid;grid-template-columns:repeat(3,max-content);gap:24px;overflow:visible}.shots img{width:calc(220 * var(--u))}}
details{border-bottom:calc(2 * var(--u)) solid var(--night)}
summary{display:flex;justify-content:space-between;align-items:center;gap:16px;min-height:56px;padding:12px 0;font-size:33px;line-height:33px;color:var(--snow);cursor:pointer;list-style:none}
summary::-webkit-details-marker{display:none}
summary:hover{color:var(--gold)}
summary::after{content:"";flex:none;width:14px;height:14px;background:linear-gradient(currentColor,currentColor) center/14px 4px no-repeat,linear-gradient(currentColor,currentColor) center/4px 14px no-repeat}
details[open] summary::after{background:linear-gradient(currentColor,currentColor) center/14px 4px no-repeat}
details p{margin:0 0 20px}
.posts{list-style:none;padding:0;margin:24px 0 0}
.posts li{padding:20px 0;border-bottom:calc(2 * var(--u)) solid var(--night)}
.posts time{font:22px/22px Micro5,monospace;-webkit-font-smoothing:none}
.posts h2{margin:10px 0 8px;padding:0;border:0;font-size:33px;line-height:33px}
.posts h2 a{text-decoration:none}
.posts h2 a:hover{text-decoration:underline}
.posts p{margin:0}
.post{max-width:46rem;margin-inline:auto}
.post > .meta{font:22px/22px Micro5,monospace;-webkit-font-smoothing:none;margin:-8px 0 24px}
.post .back{font:22px/22px Micro5,monospace;-webkit-font-smoothing:none;margin-top:36px}
.post figure{margin:36px 0}
.post figcaption{color:var(--lilac);font-size:16px;margin-top:10px}
.post p{line-height:1.65}

/* motion: whole steps, like a board redrawing; none at all when reduced motion is set */
@media (prefers-reduced-motion:no-preference){
  .js .led{animation:power .24s steps(3,end) both}
  .js .word{animation:write 1s steps(15,end) .24s both}
  .js .tagline{animation:write .5s steps(16,end) 1.1s both}
  .js .cells dd{animation:write .4s steps(12,end) both}
  .js .cells div:nth-child(1) dd{animation-delay:1.4s}
  .js .cells div:nth-child(2) dd{animation-delay:1.55s}
  .js .cells div:nth-child(3) dd{animation-delay:1.7s}
  .js .screen{animation:power .36s steps(4,end) .3s both}
  .js .panel.roll .frame{animation:roll .32s steps(8,end) both}
  .js .flip.on{animation:write .45s steps(6,end) both}
  .js .rows [aria-selected=true] .state{animation:write .3s steps(6,end) both}
}
@keyframes power{from{opacity:0}to{opacity:1}}
@keyframes write{from{clip-path:inset(0 100% 0 0)}to{clip-path:inset(0)}}
@keyframes roll{from{clip-path:inset(0 0 100% 0)}to{clip-path:inset(0)}}
