/* The front page at sombra.wtf, on top of the request site's stylesheet: the
   same desktop, with what runs here as icons down one side and windows that
   open onto more once someone signs in. */

.home { display: grid; gap: 16px; }
.home[data-tier="loading"] .windows { visibility: hidden; }

/* On a phone the two sides are one column, in the order each window names. */
.side { display: contents; }
[data-order="1"] { order: 1; }
[data-order="2"] { order: 2; }
[data-order="3"] { order: 3; }
[data-order="4"] { order: 4; }
[data-order="5"] { order: 5; }
[data-order="6"] { order: 6; }
[data-order="7"] { order: 7; }
[data-order="8"] { order: 8; }
[data-order="9"] { order: 9; }
[data-order="10"] { order: 10; }

.home .dialog { max-width: none; margin: 0; }
/* Full width even when what is in them is narrow, as the sign-in is. */
.home .windows { width: 100%; }

/* ---- icons ---- */

.icons { width: 100%; max-width: 640px; margin: 0 auto; }
.icon-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }

.icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 4px 8px;
  color: inherit;
  text-align: center;
  text-decoration: none;
}
.icon-tile {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: 4px;
  border: var(--frame) solid var(--ink);
  background: var(--paper);
  box-shadow: 4px 4px 0 var(--ink);
}
.icon-tile svg { width: 36px; height: 36px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: square; }
.icon-name { padding: 1px 6px; font-size: var(--small); font-weight: 700; text-transform: uppercase; }
.icon-state { min-height: 1.3em; color: var(--dim); font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; font-variant-numeric: tabular-nums; }

/* Down, it is drawn greyed out as the real thing did, through a checkerboard,
   and says so in the two inks swapped. */
.icon[data-state="down"] .icon-tile svg { mask: repeating-conic-gradient(#000 0 25%, transparent 0 50%) 0 0 / 2px 2px; }
.icon[data-state="down"] .icon-state { padding: 0 5px; background: var(--ink); color: var(--paper); }

.icon:focus-visible { outline: none; }
.icon:focus-visible .icon-name, .icon:active .icon-name { background: var(--ink); color: var(--paper); }
.icon:active .icon-tile { background: var(--ink); color: var(--paper); box-shadow: none; transform: translate(4px, 4px); }

@media (hover: hover) {
  .icon:hover .icon-tile { background: var(--ink); color: var(--paper); }
  .icon:hover .icon-name { background: var(--ink); color: var(--paper); }
  a.button:hover { background: var(--ink); color: var(--paper); }
}

/* ---- shared pieces ---- */

.drop a.drop-item { color: inherit; text-decoration: none; }

a.button { display: inline-flex; align-items: center; justify-content: center; color: var(--ink); text-decoration: none; }
a.plain { display: flex; align-items: center; justify-content: center; color: inherit; }

.pane > .lede:first-child, .pane > .form:first-child { margin-top: 0; }

/* Rows that start with a band put it against the window's edge. */
.flush > li { padding-left: 0; }
/* What is waiting on someone is read in full, not cut short. */
#waiting .about > * { overflow-wrap: anywhere; white-space: normal; }

.end { flex: none; font-size: var(--small); font-weight: 700; font-variant-numeric: tabular-nums; text-transform: uppercase; }

/* ---- the library ---- */

.tally { padding-bottom: 14px; }
.tally-lead { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; }
.count { font: italic 700 clamp(3.25rem, 18vw, 5.5rem)/0.9 var(--face); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.count-word { font: italic 700 clamp(1.25rem, 6vw, 1.75rem)/1 var(--face); text-transform: uppercase; }
.tally .hint { margin-top: 10px; }

/* Rules between the cells are the ink showing through the gaps. */
.tally-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--rule);
  margin: 0;
  border-top: var(--rule) solid var(--ink);
  background: var(--ink);
}
.tally-grid > div { padding: 10px 14px 12px; background: var(--paper); }
.tally-grid dt, .meters dt, .apps dt { font-size: var(--small); font-weight: 700; text-transform: uppercase; }
.tally-grid dd { margin: 2px 0 0; font: italic 700 1.625rem/1.1 var(--face); font-variant-numeric: tabular-nums; }

.covers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 10px; padding: 14px 12px 18px; }
.covers li { min-width: 0; }
.covers .cover { width: 100%; height: auto; aspect-ratio: 1; margin-bottom: 6px; }
.covers .title, .covers .more { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow-wrap: anywhere; }
.covers .title { font-size: var(--small); line-height: 1.25; }
.covers .more { -webkit-line-clamp: 1; }

/* ---- the machine ---- */

.meters { margin: 0; }
.meters > div { padding: 10px 12px 12px; }
.meters > div + div { border-top: var(--rule) solid var(--ink); }
.meters dt { display: flex; justify-content: space-between; gap: 12px; }
.meters dt > span:last-child { font-variant-numeric: tabular-nums; }
.meters dd { margin: 4px 0 0; }
.meters .strip { margin-top: 8px; }

/* ---- on your phone ---- */

.home .field input[readonly] { font-size: 1rem; }
.apps { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 18px 0 0; }
.apps dt { padding-top: 1px; }
.apps dd { margin: 0; }

@media (min-width: 560px) {
  .tally-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .covers { grid-template-columns: repeat(4, minmax(0, 1fr)); padding-inline: 20px; }
}

/* Room for a desktop: the icons go down the right edge, as they did on the
   real thing, and the windows sit two abreast to their left. */
@media (min-width: 1000px) {
  .home { grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 24px; max-width: 1400px; margin: 0 auto; }
  .home .icons { order: 2; position: sticky; top: 24px; width: auto; }
  .icon-list { grid-template-columns: 104px; gap: 12px; }
  .home .windows { order: 1; width: 100%; max-width: none; }
  .side { display: grid; gap: 24px; align-content: start; min-width: 0; }
}
