/* ==========================================================================
   The system, drawn
   --------------------------------------------------------------------------
   Two failed passes are behind this file. The first was a dark dashboard with
   badges, counters, sparklines and a gantt chart: every device at once, which
   is what makes a screen look generated. The second stripped it back so far
   that nothing was left but grey type on white, which reads as dull.

   What works is contrast rather than quantity. A near-black rail against a
   white pane. Two figures set large enough to be the focus. The job happening
   right now as a solid block of colour instead of a four pixel dot. Colour
   used in areas, not in specks.

   Every name and figure inside is illustrative. It shows the shape and the
   density of the product, not a screenshot of a real account.
   ========================================================================== */

.screen {
  --sc-paper: #fff;
  --sc-ink: #08080b;
  --sc-mid: #43434a;
  --sc-mute: #8b8b93;
  --sc-line: rgb(0 0 0 / 0.09);
  --sc-dark: var(--panel-dark);
  --sc-accent: #0130f9;

  width: 100%;
  border-radius: clamp(14px, 1.4vw, 20px);
  background: var(--sc-paper);
  color: var(--sc-ink);
  font-family: London, system-ui, sans-serif;
  overflow: hidden;

  /* The deepest step of the shared lift, plus a hairline of light along the
     top edge, which is this object's own: it is the only white panel that
     ever sits on a blue ground.

     It used to carry a three layer shadow of its own invention and read as
     sitting in a different room from the price panel above it. */
  box-shadow: var(--edge-light), var(--lift-3);
  transform: translateY(0);
  transition: transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.7s ease;
}

.screen:hover,
.screen:focus-within {
  transform: translateY(-6px);
  /* The six pixel rise is the feedback. A second, deeper shadow on top of it
     was a fourth value nobody could name. */
  box-shadow: var(--edge-light), var(--lift-3);
}

/* --- Chrome --------------------------------------------------------------- */

/* No traffic lights: three coloured dots are the first thing that says a
   screen was drawn by somebody imitating a screen. */
.screen__bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: clamp(0.85rem, 1.4vw, 1.15rem) clamp(1.1rem, 2vw, 1.7rem);
  border-bottom: 1px solid var(--sc-line);
}

.screen__mark { font-family: Asgard, Impact, sans-serif; font-size: 0.84rem; }
.screen__where { font-size: 0.82rem; color: var(--sc-mute); flex: 1; }

.screen__stamp {
  font-family: PlexMono, ui-monospace, monospace;
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sc-accent);
}

/* --- Rail ----------------------------------------------------------------- */

/* Near-black against the white pane. This one decision is most of the
   difference between an object and a spreadsheet. */
.screen__body { display: grid; grid-template-columns: minmax(9.5rem, 13rem) 1fr; }

.screen__rail {
  display: grid;
  align-content: start;
  gap: 0.15rem;
  padding: clamp(0.9rem, 1.6vw, 1.3rem) 0.65rem;
  background: var(--sc-dark);
}

.screen__tab {
  appearance: none;
  border: 0;
  border-radius: 8px;
  background: none;
  color: rgb(255 255 255 / 0.55);
  font: inherit;
  font-size: 0.88rem;
  text-align: left;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  transition: color 0.16s ease, background 0.16s ease;
}

.screen__tab:hover { color: #fff; background: rgb(255 255 255 / 0.08); }

.screen__tab[aria-selected="true"] {
  color: #fff;
  background: var(--sc-accent);
  font-weight: 500;
}

/* --- Panes ---------------------------------------------------------------- */

.screen__panes {
  padding: clamp(0.9rem, 1.6vw, 1.5rem);
  display: grid;
  align-content: start;
  min-height: 16rem;
}

.screen__pane { display: grid; gap: clamp(0.8rem, 1.5vw, 1.2rem); align-content: start; }
.screen__pane[hidden] { display: none; }

.screen__pane:not([hidden]) { animation: pane 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@keyframes pane {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.pane__head { display: grid; gap: 0.7rem; }

/* Two figures, set large. A table with no focal point is the definition of a
   dull screen. */
.pane__stats { display: flex; flex-wrap: wrap; gap: clamp(1.4rem, 4vw, 3.4rem); }

.stat { display: grid; gap: 0.1rem; }

.stat b {
  font-family: Asgard, Impact, sans-serif;
  font-weight: 500;
  font-size: clamp(1.9rem, 1rem + 2.4vw, 3.2rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  color: var(--sc-ink);
}

.stat span {
  font-family: PlexMono, ui-monospace, monospace;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sc-mute);
}

.pane__note { font-size: 0.88rem; color: var(--sc-mid); max-width: 52ch; }

/* --- The table ------------------------------------------------------------ */

.pane__table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.88rem; }

.pane__table th {
  text-align: left;
  font-family: PlexMono, ui-monospace, monospace;
  font-weight: 400;
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sc-mute);
  padding: 0 0.75rem 0.65rem;
}

.pane__table th.num,
.pane__table td.num { text-align: right; }

.pane__table td {
  padding: clamp(0.5rem, 0.85vw, 0.72rem) 0.75rem;
  border-top: 1px solid var(--sc-line);
  color: var(--sc-mid);
  white-space: nowrap;
}

.pane__table td.lead { color: var(--sc-ink); font-family: PlexMono, ui-monospace, monospace; }
.pane__table td.body { white-space: normal; color: var(--sc-ink); }
.pane__table td.num { font-variant-numeric: tabular-nums; }

.pane__table tbody tr { transition: background 0.16s ease; }
.pane__table tbody tr:hover td { background: rgb(0 0 0 / 0.03); }

/* Crew as a filled initial rather than the word repeated down the column.
   The cell is a flex row: vertical-align on an inline-grid never lines up
   with the text beside it and the discs sat half a line low. */
.pane__table td.who {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
}

.who__dot {
  display: grid;
  place-items: center;
  width: 1.35rem;
  height: 1.35rem;
  flex: none;
  border-radius: 50%;
  background: var(--sc-ink);
  color: #fff;
  font-family: PlexMono, ui-monospace, monospace;
  font-size: 0.6rem;
  font-style: normal;
  line-height: 1;
}

/* The job happening right now, as a solid block. Colour in an area, which is
   what a four pixel dot could never do. */
.pane__table tr.is-live td {
  background: var(--sc-accent);
  color: rgb(255 255 255 / 0.82);
  border-top-color: transparent;
}
.pane__table tr.is-live td.lead,
.pane__table tr.is-live td.body { color: #fff; }
.pane__table tr.is-live td:first-child { border-radius: 8px 0 0 8px; }
.pane__table tr.is-live td:last-child { border-radius: 0 8px 8px 0; }
.pane__table tr.is-live:hover td { background: var(--sc-accent); }
.pane__table tr.is-live .who__dot { background: rgb(255 255 255 / 0.9); color: var(--sc-accent); }

.pane__table tr.is-live .state--live { color: #fff; position: relative; padding-right: 1.4rem !important; }
.pane__table tr.is-live .state--live::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 0.75rem;
  width: 0.44rem;
  height: 0.44rem;
  margin-top: -0.22rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 0 rgb(255 255 255 / 0.7);
  animation: livedot 2.4s ease-out infinite;
}

@keyframes livedot {
  0% { box-shadow: 0 0 0 0 rgb(255 255 255 / 0.6); }
  70%, 100% { box-shadow: 0 0 0 0.6rem rgb(255 255 255 / 0); }
}

.state { color: var(--sc-mute); }
.state--done { color: var(--sc-ink); }
.state--warn { color: var(--red); }

/* --- Footer --------------------------------------------------------------- */

.screen__foot {
  padding: clamp(0.85rem, 1.5vw, 1.2rem) clamp(1.1rem, 2vw, 1.7rem);
  border-top: 1px solid var(--sc-line);
  font-size: 0.78rem;
  color: var(--sc-mute);
}

/* --- Narrow --------------------------------------------------------------- */

@media (max-width: 61.99rem) {
  .screen, .screen:hover, .screen:focus-within { transform: none; }
}

/* Nine modules down the side would eat the panel on a phone, so the rail runs
   across the top as a scroller instead. */
@media (max-width: 44rem) {
  .screen__body { grid-template-columns: 1fr; }
  .screen__rail {
    display: flex;
    overflow-x: auto;
    gap: 0.25rem;
    padding: 0.6rem;
  }
  .screen__tab { white-space: nowrap; }
  .pane__table { font-size: 0.8rem; }
  .pane__table th:nth-child(3),
  .pane__table td:nth-child(3) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .screen, .screen:hover, .screen:focus-within { transform: none; transition: none; }
  .screen__pane:not([hidden]) { animation: none; }
  .pane__table tr.is-live .state--live::after { animation: none; }
}

/* --- Icons and the one line that matters ---------------------------------- */

/* Nine glyphs on one stroke weight. They give the rail a rhythm the labels
   alone could not, and at this size a shape is read before a word is. */
.screen__tab { display: flex; align-items: center; gap: 0.62rem; }

.screen__tab svg {
  width: 1.05rem;
  height: 1.05rem;
  flex: none;
  opacity: 0.72;
  transition: opacity 0.16s ease;
}

.screen__tab:hover svg,
.screen__tab[aria-selected="true"] svg { opacity: 1; }

/* The footer is four claims and only one of them is the offer. */
.screen__foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.8rem;
  align-items: baseline;
}

.screen__foot b {
  font-weight: 500;
  color: var(--sc-accent);
  padding: 0.1rem 0.5rem;
  margin-left: 0.1rem;
  border-radius: 999px;
  background: rgb(1 48 249 / 0.1);
  box-shadow: inset 0 0 0 1px rgb(1 48 249 / 0.28);
}
