/* ==========================================================================
   TeamTrek — where the hours went
   --------------------------------------------------------------------------
   The hero figure on the app and URL usage page: one project's day, ranked
   by the applications and addresses the time was actually spent in.

   A ranking, because the ranking is the product. Three other pages carry
   this as a line in a card -- "which application and address held focus" --
   and a line cannot show the thing that makes it useful: that the top three
   rows are most of the day, that three of the six are the same browser, and
   that a project's hours went somewhere nobody would have guessed.

   1056 by 482, like every other hero figure on the site.

   Drawn in CSS. Nothing here is an image or a screenshot of the product.
   ========================================================================== */

.apps {
  width: 100%; max-width: 66rem; margin-inline: auto;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--neutral-200); border-radius: var(--r-xl);
  background: #fff;
  /* Heavier than the shared shadow: the panel straddles the dark band and
     the dome, and a light shadow over the dark half disappears. */
  box-shadow: 0 30px 80px rgba(8, 40, 36, .28);
  text-align: left;
  display: flex; flex-direction: column;
}

/* ------------------------------------------------------------- the head */
.apps__head {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem;
  padding-bottom: .875rem;
  border-bottom: 1px solid var(--neutral-200);
}
.apps__project { font-size: .9375rem; font-weight: 700; color: var(--neutral-900); }
.apps__day { font-size: .8125rem; color: var(--neutral-500); }
.apps__state {
  display: flex; align-items: center; gap: .5rem;
  font-size: .6875rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--primary-700);
}
.apps__tracked {
  margin-left: auto;
  font-size: .8125rem; color: var(--neutral-600); font-variant-numeric: tabular-nums;
}
.apps__tracked b { font-weight: 700; color: var(--neutral-900); }

/* ------------------------------------------------------------- the rows */
.apps__list {
  flex: 1; min-height: 0;
  margin: .25rem 0 0; padding: 0; list-style: none;
  display: grid; grid-auto-rows: minmax(0, 1fr);
}

.apps__row {
  display: grid;
  grid-template-columns: 1.5rem 10rem minmax(0, 1fr) 4.5rem;
  align-items: center; gap: .875rem;
  border-bottom: 1px solid var(--neutral-150);
  min-width: 0;
}
.apps__row:last-child { border-bottom: 0; }
/* A row that has not arrived yet. Held, not hidden: the list keeps its
   shape while it fills, so nothing below it moves. */
.apps__row[data-waiting="true"] { visibility: hidden; }

.apps__rank {
  font-size: .75rem; font-weight: 700; color: var(--neutral-400);
  font-variant-numeric: tabular-nums;
}

.apps__what { min-width: 0; }
.apps__name {
  display: block;
  font-size: .875rem; font-weight: 700; color: var(--neutral-900);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* The address itself. Monospaced, because that is what it is, and clipped
   from the right because the front of an address is the part that says
   where somebody was. */
.apps__url {
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .6875rem; color: var(--neutral-500);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.apps__bar {
  height: 10px;
  border-radius: var(--r-pill);
  background: var(--neutral-100);
  overflow: hidden;
}
.apps__bar > span {
  display: block; height: 100%;
  width: var(--w, 0%);
  border-radius: var(--r-pill);
  background: var(--primary-500);
  transition: width var(--dur-figure) var(--ease-brand);
}
/* The browser's rows share a tint, so a reader can see that three of the
   six are the same application without being told. */
.apps__row--web .apps__bar > span { background: var(--primary-300); }

.apps__time {
  text-align: right;
  font-size: .875rem; font-weight: 700; color: var(--neutral-900);
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------- the foot */
.apps__foot {
  flex: none;
  margin: .875rem 0 0; padding-top: .875rem;
  border-top: 1px solid var(--neutral-200);
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem;
  font-size: .8125rem; color: var(--neutral-600);
}
.apps__foot .icon { flex: none; color: var(--neutral-400); }
.apps__foot b { font-weight: 700; color: var(--neutral-900); font-variant-numeric: tabular-nums; }
.apps__never { margin-left: auto; color: var(--neutral-500); }

/* ------------------------------------------------------------------ sizes */
@media (min-width: 860px) {
  /* The figure every other hero on the site carries. */
  .apps { height: 482px; }
}

@media (max-width: 859px) {
  /* Still four columns, with a narrower name. Stacking the bar under the
     name here put the card at 830px on a tablet -- a hero figure nearly
     twice the height of the one every other page carries -- and 689px is
     plenty for a rank, a name, a bar and a time. */
  .apps { padding: 1.125rem 1.25rem; }
  .apps__row { grid-template-columns: 1.25rem 7.5rem minmax(0, 1fr) 3.75rem; gap: .625rem; }
  .apps__never { margin-left: 0; width: 100%; }
}

@media (max-width: 599px) {
  .apps { padding: 1rem; }
  /* The bar goes under the name, because at 360 the two of them side by
     side are 90px each. And four rows, not six: the point is which came
     first, and four show it. */
  .apps__row { grid-template-columns: 1.25rem minmax(0, 1fr) 3.75rem; row-gap: .25rem; }
  .apps__bar { grid-column: 2 / -1; margin-bottom: .5rem; }
  .apps__row:nth-child(n + 5) { display: none; }
}

/* --------------------------------------------------------------------------
   Planned, and actual
   --------------------------------------------------------------------------
   Section 04's figure: the applications a project was set up to run in,
   against the ones its hours were spent in.

   Both rows are the same six and a half hours. The second one has a
   spreadsheet in it that nobody planned for, and that stretch is the only
   thing the section is arguing about.
   -------------------------------------------------------------------------- */
.plan {
  margin-top: 2.5rem; padding: 1.5rem;
  border: 1px solid var(--neutral-200); border-radius: var(--r-lg);
  background: #fff;
}

.plan__row {
  display: grid; grid-template-columns: 11rem minmax(0, 1fr);
  align-items: center; gap: .75rem;
  padding: 1.125rem 0;
}
.plan__row + .plan__row { border-top: 1px solid var(--neutral-150); }
.plan__name { margin: 0; font-size: .875rem; font-weight: 700; color: var(--neutral-900); }
.plan__sub { display: block; font-size: .75rem; font-weight: 400; color: var(--neutral-500); }

.plan__band {
  display: flex; gap: 3px;
  height: 2.75rem;
  border-radius: var(--r-sm);
  background: var(--neutral-50);
  box-shadow: inset 0 0 0 1px var(--neutral-150);
  padding: 3px;
  overflow: hidden;
}
.plan__seg {
  flex: 0 0 var(--w); min-width: 2px;
  border-radius: 2px;
  background: var(--seg, var(--primary-500));
  display: flex; align-items: center;
  overflow: hidden;
}
.plan__seg b {
  padding: 0 .5rem;
  font-size: .6875rem; font-weight: 700; color: #fff; white-space: nowrap;
}
.plan__seg--web { --seg: var(--primary-300); }
.plan__seg--web b { color: var(--neutral-800); }
/* The stretch nobody planned for. Amber, because it is the finding rather
   than the background. */
.plan__seg--odd { --seg: var(--warning-fill); }
.plan__seg--odd b { color: var(--warning-text); }
/* The planned row is a plan, not a measurement. Outlined rather than
   filled, so a reader does not read it as something that happened. */
.plan__row--planned .plan__seg {
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--neutral-300);
}
.plan__row--planned .plan__seg b { color: var(--neutral-600); }

@media (max-width: 859px) {
  .plan { padding: 1.25rem; }
  .plan__row { grid-template-columns: minmax(0, 1fr); row-gap: .5rem; }
  .plan__seg b { display: none; }
}
