/* TwinTowers.app: the website drawn as the main window of a desktop program
   of about 2001, open on a pixel sky (docs/DESIGN.md).

   The look comes from rickyaxel.com's desktop (four-line bevels drawn with
   box-shadow, pixel fonts at their native 16 px, pixel art at whole
   multiples, popover menus) and is turned towards the towers: the colors
   are the app icon's (its sky, haze, aluminum and the antenna's red), the
   title bars are stepped like Windows XP's with stair-stepped corners, the
   task pane is XP's, facts and the drawing are blueprints, and download
   buttons are green. Nothing here is smooth: gradients are bands, corners
   are steps, images are whole pixels.

   Interface strings are in pixel fonts (fonts.css; the server picks the
   class: .dot DotGothic16, .uni GNU Unifont, .brahmic a Pixel Brahmic font,
   .sys the system's), drawn at 16 px or 32 px; reading text is Verdana.
   Directions are logical, so right-to-left pages mirror the window.

   Breakpoints: 760 px (task pane under the document), 640 px (phone: the
   window fills the screen). */

:root {
  color-scheme: only light;

  /* The app icon's colors */
  --sky: #0184FF;
  --sky-deep: #035FCF;
  --navy: #074697;
  --haze: #A9D5FC;
  --cloud: #FCFCFD;
  --aluminum: #BDC2D0;
  --steel: #5C6779;
  --muted: #444D5C; /* gray text on aluminum, 5.7:1 */
  --ink: #1B2333;
  --beacon: #F54D21;

  /* Window chrome: aluminum faces and the classic four-line bevel */
  --face: #D6DAE2;
  --light: #EEF0F5;
  --white: #FFFFFF;
  --shadow: #898F9D;
  --dark: #1B2333;
  --raised: inset -1px -1px var(--dark), inset 1px 1px var(--white), inset -2px -2px var(--shadow), inset 2px 2px var(--light);
  --pressed: inset -1px -1px var(--white), inset 1px 1px var(--dark), inset -2px -2px var(--light), inset 2px 2px var(--shadow);
  --frame: inset -1px -1px var(--dark), inset 1px 1px var(--light), inset -2px -2px var(--shadow), inset 2px 2px var(--white);
  --field: inset -1px -1px var(--white), inset 1px 1px var(--shadow), inset -2px -2px var(--light), inset 2px 2px var(--dark);
  --status: inset -1px -1px var(--white), inset 1px 1px var(--shadow);
  --checked: repeating-conic-gradient(var(--white) 0 25%, var(--face) 0 50%) 0 0 / 2px 2px;

  /* Title bars: Windows XP's vertical blue, in bands, never blended */
  --title: linear-gradient(#5AAEFF 0 1px, #2E93FB 1px 3px, #1580F0 3px 6px, #0A70E2 6px 55%, #0662D2 55% 80%, #0556C1 80% calc(100% - 1px), #03307A calc(100% - 1px));
  --title-off: linear-gradient(#C9D0DC 0 1px, #B4BCCB 1px 3px, #A5AEBF 3px 55%, #98A2B4 55% calc(100% - 1px), #6B7486 calc(100% - 1px));
  /* Stair-stepped top corners, XP's rounded corners in pixels */
  --corners: polygon(0 4px, 1px 4px, 1px 2px, 2px 2px, 2px 1px, 4px 1px, 4px 0, calc(100% - 4px) 0, calc(100% - 4px) 1px, calc(100% - 2px) 1px, calc(100% - 2px) 2px, calc(100% - 1px) 2px, calc(100% - 1px) 4px, 100% 4px, 100% 100%, 0 100%);

  /* XP's task pane and its panels */
  --pane: linear-gradient(#8DB2F0 0 48px, #84A9EC 48px 140px, #7A9EE7 140px 280px, #7193E2 280px 460px, #6987DC 460px);
  --panel: #D6DFF7;
  --panel-ink: #1C4DAA;
  --panel-head: linear-gradient(90deg, #FFFFFF 0 45%, #E6EDFB 45% 70%, #D2DEF8 70% 88%, #C6D3F7 88%);

  /* Blueprints: the facts and the drawing */
  --blueprint: #0A3A86;
  --blueprint-line: #16509F;

  /* Downloads and confirmations */
  --go: linear-gradient(#5FBF6C 0 1px, #3A9A4A 1px 4px, #23803A 4px 60%, #1D7433 60% calc(100% - 1px), #0F4D1E calc(100% - 1px));

  /* Messages, as the information bar and the balloons of the time */
  --info: #FFFFE1;

  /* Links */
  --link: #0033CC;
  --visited: #663399;
  --hover: #CC0000;

  /* Type */
  --text: Verdana, Geneva, Tahoma, "DejaVu Sans", sans-serif;
  --ui: Tahoma, Verdana, sans-serif; /* set per page by .dot, .uni, .brahmic, .sys */
  --ui-line: 1.25;

  /* Sizes */
  --px: 1px;
  --icon: 16px;
  --gap: 12px;
  --pane-width: 236px;
  --step: 80ms;
}

/* ---- Fonts: the page's pixel font, chosen by the server --------------- */

.dot { --ui: "TT DotGothic16", "TT Unifont", Tahoma, sans-serif; }
.uni { --ui: "TT Unifont", Tahoma, sans-serif; }
.brahmic { --ui: var(--brahmic-face), "TT Unifont", sans-serif; --ui-line: var(--brahmic-line); }
.sys { --ui: Tahoma, system-ui, sans-serif; --ui-line: 1.4; }
/* Large type: Pixelify Sans where it draws the page's main heading, else
   the page's own pixel font at twice its size. Set on body, where --ui is
   the page's. */
body { --display: var(--ui); }
body.large { --display: "TT Pixelify Sans", var(--ui); }

/* A name in the language menu in another script than the page keeps the
   font that draws it whole. */
.langs .dot, .langs .uni, .langs .brahmic, .langs .sys,
.lang-button.dot, .lang-button.uni, .lang-button.brahmic, .lang-button.sys,
.lang-footer.dot, .lang-footer.uni, .lang-footer.brahmic, .lang-footer.sys {
  font-family: var(--ui);
}

/* ---- The page --------------------------------------------------------- */

* { box-sizing: border-box; }

[hidden] { display: none !important; }

/* A closed popover stays hidden whatever its class makes of it. */
[popover]:not(:popover-open) { display: none; }

html {
  background: var(--haze);
  scroll-padding-top: 12px;
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  padding: 24px max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
  color: var(--ink);
  font: 14px/1.65 var(--text);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* The desktop: the app icon's sky, dithered, with its clouds. Fixed, so it
   stays behind the window as a wallpaper does. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    url("/static/img/clouds.png?v=f1a425f3c925") repeat-x 40px 28px / 600px 180px,
    url("/static/img/clouds.png?v=f1a425f3c925") repeat-x 340px 300px / 600px 180px,
    url("/static/img/sky.png?v=57a8b79d2deb") repeat-x 0 0 / 8px 600px,
    var(--haze);
  image-rendering: pixelated;
}

img.px,
.px img {
  image-rendering: pixelated;
}

a { color: var(--link); }
a:visited { color: var(--visited); }
a:hover { color: var(--hover); }

:focus-visible {
  outline: 2px dotted var(--ink);
  outline-offset: 2px;
}

/* Hidden above the page, not to the side: off to the left would widen a
   right-to-left page by as much. A balloon tip when it has focus. */
.skip {
  position: absolute;
  top: -200px;
  inset-inline-start: 12px;
  z-index: 20;
  padding: 6px 10px;
  background: var(--info);
  border: 1px solid var(--ink);
  color: var(--ink);
  font: 16px/var(--ui-line) var(--ui);
}
.skip:focus { top: 8px; }

/* ---- Windows ---------------------------------------------------------- */

.app,
.window,
.welcome {
  min-width: 0;
  padding: 3px;
  background: var(--face);
  box-shadow: var(--frame);
}

.app {
  max-width: 1140px;
  margin: 0 auto;
  clip-path: var(--corners);
}

.window {
  display: flex;
  flex-direction: column;
  clip-path: var(--corners);
}

.title-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  margin: 0;
  padding: 3px 4px 3px 6px;
  background: var(--title);
  color: var(--white);
  font: 700 16px/var(--ui-line) var(--ui);
  text-shadow: 1px 1px 0 #03307A;
}

.title-bar img { flex: none; }

.title-bar-text {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.app-title .title-bar-text {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.window-body {
  flex: 1;
  margin: 8px 5px 5px;
}

/* A recessed white area: list views, text, the picture viewer. */
.field {
  background: var(--white);
  box-shadow: var(--field);
}

/* XP's close button, red with a white cross drawn pixel by pixel. It
   closes the window it is in (a popover). */
.close {
  position: relative;
  flex: none;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  background: linear-gradient(#F08B6B 0 1px, #E5603B 1px 4px, #D9481F 4px 70%, #C23A16 70%);
  box-shadow: inset 0 0 0 1px #FFFFFF, inset -2px -2px 0 1px #8F2A0E;
  clip-path: polygon(0 2px, 2px 2px, 2px 0, calc(100% - 2px) 0, calc(100% - 2px) 2px, 100% 2px, 100% calc(100% - 2px), calc(100% - 2px) calc(100% - 2px), calc(100% - 2px) 100%, 2px 100%, 2px calc(100% - 2px), 0 calc(100% - 2px));
  cursor: pointer;
}
.close::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 7px;
  width: 2px;
  height: 2px;
  background: #FFFFFF;
  box-shadow:
    6px 0 #FFF,
    1px 1px #FFF, 5px 1px #FFF,
    2px 2px #FFF, 4px 2px #FFF,
    3px 3px #FFF,
    2px 4px #FFF, 4px 4px #FFF,
    1px 5px #FFF, 5px 5px #FFF,
    0 6px #FFF, 6px 6px #FFF;
}
.close:hover { filter: brightness(1.12); }
.close:active { box-shadow: inset 1px 1px 0 1px #8F2A0E; }
.close:focus-visible { outline-color: var(--white); outline-offset: 1px; }

/* ---- Title bar, title screen, toolbar, address bar --------------------- */

.app-title {
  min-height: 30px;
  padding-inline-start: 8px;
}

.banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 24px;
  margin-top: 3px;
  padding: 14px 18px;
  background: linear-gradient(#074697 0 12%, #064EAA 12% 30%, #0556BD 30% 55%, #045CC8 55% 80%, #035FCF 80%);
  image-rendering: pixelated;
  box-shadow: var(--field);
  color: var(--white);
}
/* One of the icon's clouds, in the middle, where wide windows leave room
   between the name and the date line (in either direction). */
@media (min-width: 1100px) {
  .banner {
    background:
      url("/static/img/clouds.png?v=f1a425f3c925") no-repeat calc(50% + 206px) -4px / 600px 180px,
      linear-gradient(#074697 0 12%, #064EAA 12% 30%, #0556BD 30% 55%, #045CC8 55% 80%, #035FCF 80%);
  }
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  color: var(--white);
  text-decoration: none;
}
.brand:visited, .brand:hover { color: var(--white); }
.brand:focus-visible { outline-color: var(--white); }
.brand-icon { flex: none; box-shadow: 2px 2px 0 #03307A; }
.brand-text { display: block; min-width: 0; }
.brand-name {
  display: block;
  font: 700 32px/1.1 "TT Pixelify Sans", "TT DotGothic16", Tahoma, sans-serif;
  text-shadow: 2px 2px 0 #03307A;
}
.tagline {
  display: block;
  margin-top: 4px;
  font: 16px/var(--ui-line) var(--ui);
  text-shadow: 1px 1px 0 #03307A;
}
.dateline {
  margin: 0;
  font: 16px/var(--ui-line) var(--ui);
  text-align: end;
  text-shadow: 1px 1px 0 #03307A;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 12px;
  margin-top: 3px;
  padding: 3px 6px 3px 3px;
  border-bottom: 1px solid var(--shadow);
  box-shadow: 0 1px 0 var(--white);
}

.tools {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}

/* Toolbar buttons are flat until the pointer is on them, as XP's were. */
.tool {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 76px;
  min-height: 60px;
  padding: 5px 10px 4px;
  color: var(--ink);
  font: 16px/var(--ui-line) var(--ui);
  text-align: center;
  text-decoration: none;
}
.tool:visited { color: var(--ink); }
.tool:hover { color: var(--ink); box-shadow: var(--raised); background: var(--light); }
.tool:active { box-shadow: var(--pressed); }
.tool[aria-current="page"] { box-shadow: var(--pressed); background: var(--checked); }
.tool:focus-visible { outline-offset: -4px; }

/* The language drop-down: a combo box, white with its arrow button. The
   button where popovers work; elsewhere the link to /language. */
.lang { min-width: 0; max-width: 100%; }
.lang-button, .lang-menu { display: none; }
@supports selector(:popover-open) {
  .toolbar .lang-link { display: none; }
  .lang-button { display: flex; }
  .lang-menu:popover-open { display: flex; }
}

.lang-link {
  font: 16px/var(--ui-line) var(--ui);
}

.lang-button {
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-height: 32px;
  padding: 3px 3px 3px 6px;
  border: 0;
  background: var(--white);
  box-shadow: var(--field);
  color: var(--ink);
  font: 16px/var(--ui-line) var(--ui);
  cursor: pointer;
}
.lang-current {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.drop {
  position: relative;
  flex: none;
  width: 20px;
  height: 22px;
  background: var(--face);
  box-shadow: var(--raised);
}
.drop::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 9px;
  border-top: 4px solid var(--ink);
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
}
.lang-button:active .drop,
body:has(.lang-menu:popover-open) .lang-button .drop { box-shadow: var(--pressed); }

.address-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 3px;
  padding: 3px 4px;
  font: 16px/var(--ui-line) var(--ui);
}
.address-label { flex: none; color: var(--muted); }
.crumbs {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 6px;
  min-width: 0;
  margin: 0;
  padding: 4px 8px;
}
.crumb-sep { color: var(--muted); }
.crumbs strong { font-weight: normal; }

/* ---- The client area: the task pane and the document ------------------ */

.client {
  display: grid;
  grid-template-columns: var(--pane-width) minmax(0, 1fr);
  margin-top: 3px;
}

.document {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
}

.task-pane {
  grid-column: 1;
  grid-row: 1;
  padding: 12px;
  background: var(--pane);
}

/* A task panel, as XP's file windows had: a header that folds the panel. */
.task {
  margin-bottom: 12px;
  background: var(--panel);
  box-shadow: inset 0 0 0 1px var(--white);
}
.task-title {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 4px 6px 4px 8px;
  background: var(--panel-head);
  color: var(--panel-ink);
  clip-path: var(--corners);
  cursor: pointer;
  list-style: none;
}
[dir="rtl"] .task-title { background: linear-gradient(270deg, #FFFFFF 0 45%, #E6EDFB 45% 70%, #D2DEF8 70% 88%, #C6D3F7 88%); }
.task-title::-webkit-details-marker { display: none; }
.task-title::after {
  content: "";
  flex: none;
  width: 16px;
  height: 16px;
  margin-inline-start: auto;
  background: url("/static/img/icons/fold.png?v=e7e2f34bfbec") 0 0 / 16px 16px;
  image-rendering: pixelated;
}
.task:not([open]) > .task-title::after { background-image: url("/static/img/icons/unfold.png?v=172d60969852"); }
.task-title:hover { color: #428EFF; }
.task-title h2 {
  margin: 0;
  font: 700 16px/var(--ui-line) var(--ui);
}

.task-list {
  margin: 0;
  padding: 8px 6px;
  list-style: none;
  font: 16px/var(--ui-line) var(--ui);
}
.task-list li { margin: 0; }
.task-list a {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 4px;
  color: var(--panel-ink);
  text-decoration: none;
}
.task-list a:hover { color: #428EFF; text-decoration: underline; }
.task-list img { flex: none; margin-top: 1px; }

.stores-list li {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 4px;
}
.stores-list img { flex: none; margin-top: 1px; }
.stores-list strong { display: block; color: var(--ink); font-weight: normal; }
.stores-list a { display: inline; padding: 0; color: var(--panel-ink); text-decoration: underline; }
.soon { color: var(--muted); }

/* Quick facts: a blueprint, white figures on its grid. */
.blueprint {
  margin: 0;
  padding: 10px 10px 8px;
  background:
    linear-gradient(var(--blueprint-line) 1px, transparent 1px) 0 0 / 10px 10px,
    linear-gradient(90deg, var(--blueprint-line) 1px, transparent 1px) 0 0 / 10px 10px,
    var(--blueprint);
  color: var(--white);
}
.facts { margin: 0; font: 16px/var(--ui-line) var(--ui); }
.facts div { margin-bottom: 8px; }
.facts dt { color: var(--white); font-weight: 700; }
.facts dd { margin: 0; color: #BFD8FF; }
.facts-note {
  margin: 0;
  padding-top: 6px;
  border-top: 1px dotted #6FA0E4;
  color: #BFD8FF;
  font-size: 12px;
  line-height: 1.5;
}
.facts-note a, .facts-note a:visited { color: #FFE27A; }
.facts-note a:hover { color: var(--white); }
.blueprint :focus-visible { outline-color: var(--white); }

/* A document in a reader: white paper, recessed. */
.paper {
  padding: 20px 28px 14px;
  background: var(--white);
  box-shadow: var(--field);
}

/* The home page: windows on a workspace, a draughtsman's grid, two
   columns of them where the document is wide enough. */
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--gap);
  align-content: start;
  padding: var(--gap);
  background:
    linear-gradient(#9AABC4 1px, transparent 1px) 0 0 / 16px 16px,
    linear-gradient(90deg, #9AABC4 1px, transparent 1px) 0 0 / 16px 16px,
    #A8B7CD;
  box-shadow: var(--field);
}

@media (min-width: 1100px) {
  .workspace { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .welcome, .notice, .totop, .l10n-notice { grid-column: 1 / -1; }
}

/* ---- Text ------------------------------------------------------------- */

p { margin: 0 0 12px; }
.text > :last-child,
.text > :last-child > :last-child { margin-bottom: 0; }
.text p, .text li, .text dd { max-width: 74ch; }

ul {
  margin: 0 0 12px;
  padding-inline-start: 22px;
  list-style: none;
}
li { position: relative; margin-bottom: 6px; }
/* A bevelled pixel square for a bullet. */
.text li::before,
.welcome li::before {
  content: "";
  position: absolute;
  inset-inline-start: -16px;
  top: 0.62em;
  width: 6px;
  height: 6px;
  background: var(--sky);
  box-shadow: inset -1px -1px var(--navy), inset 1px 1px var(--haze);
}

code { font: 13px "Courier New", Courier, monospace; }
.name { font-weight: bold; }
.fine { color: var(--steel); font-size: 12px; }

h1 {
  margin: 0;
  color: var(--navy);
  font: 700 32px/1.15 var(--display);
}
/* Brahmic scripts stack marks above and below: at twice the size, their
   lines are twice as tall as the script needs (fonts.css). */
.brahmic h1 { line-height: calc(2 * var(--brahmic-line)); }

.date {
  margin: 4px 0 0;
  color: var(--steel);
  font: 16px/var(--ui-line) var(--ui);
}

/* A document's heading, with its icon, over a double rule. */
.doc-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--navy);
  box-shadow: 0 2px 0 var(--white), 0 3px 0 var(--haze);
}
.doc-icon { flex: none; }
.intro { margin-bottom: 18px; }

/* A topic's heading: a band, as reference programs had. */
.topic { margin-top: 22px; }
.topic h2 {
  margin: 0 0 10px;
  padding: 4px 10px;
  border-top: 1px solid #9DB9EB;
  background: linear-gradient(90deg, #D7E4FA 0 55%, #E6EEFC 55% 80%, #F4F7FE 80% 92%, #FFFFFF 92%);
  color: #0B3C8C;
  font: 700 16px/var(--ui-line) var(--ui);
}
[dir="rtl"] .topic h2 { background: linear-gradient(270deg, #D7E4FA 0 55%, #E6EEFC 55% 80%, #F4F7FE 80% 92%, #FFFFFF 92%); }

/* Definition lists: the sources, each an entry with a document icon. */
.defs { margin: 0 0 12px; }
.defs dt {
  margin-top: 12px;
  padding-inline-start: 24px;
  background: url("/static/img/icons/page.png?v=1cfbd118b517") no-repeat 0 0.15em / 16px 16px;
  image-rendering: pixelated;
  font-weight: bold;
  color: var(--ink);
}
[dir="rtl"] .defs dt { background-position: right 0 top 0.15em; }
.defs dt:first-child { margin-top: 0; }
.defs dd {
  margin: 4px 0 0;
  margin-inline-start: 24px;
  padding-inline-start: 10px;
  border-inline-start: 2px solid var(--haze);
}

/* The contact address image: as tall as a line of text, on its baseline */
.contact-email { height: 1.2em; width: auto; vertical-align: -0.2em; }
.nowrap { white-space: nowrap; }

/* Notices: the information bar of the time, yellow with an icon. */
.l10n-notice,
.notice {
  margin: 0 0 var(--gap);
  padding: 6px 10px;
  background: var(--info);
  border: 1px solid var(--ink);
  box-shadow: 2px 2px 0 rgba(27, 35, 51, 0.35);
  font-size: 12px;
  line-height: 1.5;
}
.notice {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 0;
}
.notice img { flex: none; margin-top: 1px; }
.notice span { min-width: 0; }

.totop {
  margin: 18px 0 0;
  font: 16px/var(--ui-line) var(--ui);
  text-align: end;
}
.workspace .totop { margin: 0; }
.totop a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.workspace .totop a { color: var(--ink); }

/* ---- Buttons ---------------------------------------------------------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 96px;
  min-height: 34px;
  padding: 6px 16px;
  background: linear-gradient(#F4F5F8 0 2px, #E6E8EE 2px 50%, #D6DAE2 50%);
  box-shadow: var(--raised);
  color: var(--ink);
  font: 16px/var(--ui-line) var(--ui);
  text-align: center;
  text-decoration: none;
}
.button:visited, .button:hover { color: var(--ink); }
.button:hover { background: linear-gradient(#FFFFFF 0 2px, #EEF0F5 2px 50%, #E0E4EB 50%); }
.button:active { box-shadow: var(--pressed); }
.button:focus-visible { outline-offset: -6px; }
.button.disabled {
  color: var(--shadow);
  text-shadow: 1px 1px 0 var(--white);
  cursor: default;
}
.button.disabled:hover { background: linear-gradient(#F4F5F8 0 2px, #E6E8EE 2px 50%, #D6DAE2 50%); }

/* Download buttons are green, as the start of something was. */
.store .button:not(.disabled) {
  background: var(--go);
  box-shadow: inset -1px -1px #0A3514, inset 1px 1px #8BDA95, inset -2px -2px #145A24, inset 2px 2px #4DB25B;
  color: var(--white);
  text-shadow: 1px 1px 0 #0A3514;
}
.store .button:not(.disabled):hover { filter: brightness(1.1); }
.store .button:not(.disabled):active { box-shadow: inset 1px 1px #0A3514, inset 2px 2px #145A24; }
.store .button:not(.disabled):focus-visible { outline-color: var(--white); }

/* ---- Home: the welcome ------------------------------------------------ */

/* The welcome: the text and the download window beside the blueprint. */
.welcome {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  grid-template-areas: "figure text" "figure get";
  gap: 12px 14px;
  padding: 12px;
}
.welcome-text { grid-area: text; }
.download { grid-area: get; }
.elevation {
  grid-area: figure;
  margin: 0;
}
.elevation-frame {
  padding: 3px;
  background: var(--white);
  box-shadow: var(--field);
  line-height: 0;
}
.towers { display: block; width: 120px; height: 360px; }
.elevation figcaption {
  width: 126px;
  margin-top: 6px;
  color: var(--muted);
  font: 16px/var(--ui-line) var(--ui);
  text-align: center;
}

.welcome-text {
  min-width: 0;
  padding: 12px 16px;
  background: var(--white);
  box-shadow: var(--field);
}
.welcome-text h1 { margin-bottom: 12px; }
.welcome-text > :last-child { margin-bottom: 0; }

/* ---- Home: the download window ---------------------------------------- */

.package {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 10px;
  padding: 10px;
}
.package-icon {
  flex: none;
  padding: 4px;
  background: var(--white);
  box-shadow: var(--field);
}
.package-name {
  margin: 0 0 6px;
  color: var(--navy);
  font: 700 32px/1.1 "TT Pixelify Sans", "TT DotGothic16", Tahoma, sans-serif;
}
.package-text { min-width: 0; }
.package-text p:last-child { margin-bottom: 0; }

.stores {
  margin: 0;
  padding: 2px;
  list-style: none;
  background: var(--white);
  box-shadow: var(--field);
}
.store {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 12px;
  margin: 0;
  padding: 10px 12px;
}
.store + .store { border-top: 1px dotted var(--shadow); }
.store-name {
  margin: 0;
  font: 700 16px/var(--ui-line) var(--ui);
}

/* ---- Home: the picture viewer ----------------------------------------- */

.shots {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 10px;
  list-style: none;
  background: var(--white);
  box-shadow: var(--field);
}
.shot { margin: 0; }
.shot-open,
.shot-link {
  display: block;
  width: 100%;
  padding: 3px;
  border: 0;
  background: var(--face);
  box-shadow: var(--raised);
  cursor: zoom-in;
}
.shot-open img,
.shot-link img {
  display: block;
  width: 100%;
  height: auto;
  box-shadow: 0 0 0 1px var(--shadow);
}
.shot-open:active { box-shadow: var(--pressed); }
.shot-open:focus-visible, .shot-link:focus-visible { outline-offset: 1px; }
.shot-link { display: none; }
@supports not selector(:popover-open) {
  .shot-open { display: none; }
  .shot-link { display: block; }
}
.shot-caption {
  margin: 6px 0 0;
  font: 16px/var(--ui-line) var(--ui);
  text-align: center;
}

.status-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin: 4px 0 0;
}
.status {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  padding: 2px 8px;
  box-shadow: var(--status);
  font: 16px/var(--ui-line) var(--ui);
}
.status.count { flex: none; }

/* Popover windows: the picture viewer and the language list, centered,
   over the page dimmed with a dither as the shut-down screen of the
   time was. They open in four steps, unless motion is reduced. */
[popover].window {
  inset: 0;
  margin: auto;
  border: 0;
  color: var(--ink);
  overflow: hidden;
}
[popover].window::backdrop {
  background: repeating-conic-gradient(rgba(3, 32, 82, 0.45) 0 25%, transparent 0 50%) 0 0 / 2px 2px;
}
[popover].window:popover-open {
  display: flex;
  animation: open calc(var(--step) * 4) steps(4, end);
}
@keyframes open {
  from { clip-path: inset(0 0 100% 0); }
  to { clip-path: inset(0 0 0 0); }
}

.viewer {
  width: min(460px, calc(100vw - 16px));
  max-height: calc(100dvh - 16px);
}
.viewer-body {
  flex: 1;
  min-height: 0;
  margin: 6px 3px 0;
  padding: 6px;
  text-align: center;
  line-height: 0;
}
.viewer-body img {
  max-width: 100%;
  max-height: calc(100dvh - 120px);
  width: auto;
  height: auto;
}
.viewer .status-bar { margin: 3px; }

/* ---- The language list ------------------------------------------------ */

.lang-menu {
  width: min(640px, calc(100vw - 16px));
  max-height: min(620px, calc(100dvh - 24px));
}
.menu-body {
  flex: 1;
  min-height: 0;
  margin: 6px 3px 3px;
  overflow: auto;
}

.langs {
  margin: 0;
  padding: 4px;
  list-style: none;
  columns: 2 240px;
  column-gap: 8px;
  font: 16px/var(--ui-line) var(--ui);
}
.langs li { margin: 0; break-inside: avoid; }
.langs a {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 8px;
  padding: 4px 8px;
  padding-inline-start: 26px;
  color: var(--ink);
  text-decoration: none;
}
.langs a:hover,
.langs a:focus-visible {
  background: #316AC5;
  color: var(--white);
  outline: none;
}
.langs .english { color: var(--steel); font-size: 16px; }
.langs a:hover .english, .langs a:focus-visible .english { color: #DCE8FF; }
/* A 7 x 7 pixel check, as menus mark the chosen item. */
.langs a[aria-current="true"]::before {
  content: "";
  position: absolute;
  inset-inline-start: 9px;
  top: calc(50% - 3px);
  width: 1px;
  height: 1px;
  background: currentColor;
  box-shadow:
    6px 0 currentColor, 5px 1px currentColor, 6px 1px currentColor,
    4px 2px currentColor, 5px 2px currentColor, 0 3px currentColor, 3px 3px currentColor, 4px 3px currentColor,
    0 4px currentColor, 1px 4px currentColor, 2px 4px currentColor, 3px 4px currentColor,
    1px 5px currentColor, 2px 5px currentColor, 2px 6px currentColor;
}
[dir="rtl"] .langs a[aria-current="true"]::before { transform: scaleX(-1); }
.langs .separator {
  margin: 3px 2px;
  border-top: 1px solid var(--shadow);
  border-bottom: 1px solid var(--white);
  column-span: all;
}
.legend {
  margin: 0;
  padding: 0 12px 8px;
  color: var(--steel);
  font: 16px/var(--ui-line) var(--ui);
}

/* The language page: the same list, in its document. */
.lang-page { padding: 4px; }

/* ---- Footer: about and status bar ------------------------------------- */

.app-foot { margin-top: 3px; }

.about {
  padding: 10px 14px;
  border-top: 1px solid var(--shadow);
  box-shadow: inset 0 1px 0 var(--white);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}
.about nav {
  margin-bottom: 6px;
  font: 16px/var(--ui-line) var(--ui);
}
.about nav span { margin: 0 6px; color: var(--shadow); }
.about p { margin: 2px 0; }

.app-foot .status-bar { margin: 0; }
.app-foot .status { flex: 1 1 180px; }
.lang-footer {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* The skyline under the window, the towers in its middle. */
.skyline {
  height: 144px;
  margin: 18px calc(-1 * max(16px, env(safe-area-inset-left))) 0;
  background: url("/static/img/skyline.png?v=5355a9355dc8") no-repeat center bottom / 1920px 144px;
  image-rendering: pixelated;
}

/* ---- Narrow windows --------------------------------------------------- */

@media (max-width: 760px) {
  .client { grid-template-columns: minmax(0, 1fr); }
  .document { grid-column: 1; grid-row: 1; }
  .task-pane { grid-column: 1; grid-row: 2; }
}

/* Phones: the window fills the screen, as a maximised one did. */
@media (max-width: 640px) {
  body {
    padding: 0 env(safe-area-inset-right) 0 env(safe-area-inset-left);
    font-size: 15px;
  }
  .app { clip-path: none; }
  .banner { padding: 12px; }
  .brand { gap: 10px; }
  .brand-icon { width: 32px; height: 32px; }
  .dateline { width: 100%; text-align: start; }
  .toolbar { padding: 3px; }
  /* Four buttons across; a language with long words wraps a button to a
     second row rather than a word. */
  .tools { width: 100%; }
  .tool { flex: 1 0 auto; min-width: 64px; padding-inline: 4px; }
  .lang { width: 100%; }
  .lang-button { width: 100%; }
  .lang-current { flex: 1; text-align: start; }
  .address-label { display: none; }
  .workspace { padding: 6px; gap: 8px; }
  .paper { padding: 16px 14px 12px; }
  .welcome {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
    grid-template-areas: "text" "get" "figure";
    gap: 8px;
    padding: 6px;
  }
  .welcome-text { padding: 12px; }
  .elevation { display: flex; gap: 12px; align-items: flex-end; padding: 6px; box-shadow: var(--status); }
  .elevation figcaption { width: auto; text-align: start; }
  .package { flex-direction: column; align-items: flex-start; padding: 6px 2px; }
  .store { grid-template-columns: 32px minmax(0, 1fr); }
  .store .button { grid-column: 1 / -1; width: 100%; }
  .shots { gap: 6px; padding: 6px; }
  .doc-head { align-items: flex-start; }
  h1 { font-size: 32px; }
  .skyline { margin-inline: 0; }
}

/* Touch: bigger targets where the pointer is a finger. */
@media (pointer: coarse) {
  .task-list a, .stores-list li { min-height: 40px; align-items: center; }
  .langs a { padding-block: 8px; }
  .close { width: 32px; height: 32px; }
  .close::before { left: 12px; top: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  [popover].window:popover-open { animation: none; }
}

@media print {
  body::before, .skyline, .task-pane, .toolbar, .address-bar, .banner, .totop { display: none; }
  body { padding: 0; }
  .app, .paper, .workspace, .window, .welcome { box-shadow: none; clip-path: none; background: none; }
}
