/* ==========================================================================
   TeamTrek — the running timer, and the week it is adding to
   --------------------------------------------------------------------------
   The hero figure on the project time tracking page: one timer running on
   one task, and the four projects of the week beside it.

   A timer rather than a report. The page's argument is that the project is
   chosen before the hour rather than reconstructed after it, and the only
   picture of that is a clock with a project name under it. The week beside
   it is what the clock is adding to, so the panel says the whole sentence
   in one look: this second goes there.

   1056 by 482, like every other hero figure on the site. Two columns,
   because a clock wide enough to read and a list of four projects do not
   stack inside 482 without one of them becoming decoration.

   Nothing here is an image. The bars are spans with a width on them, so the
   panel costs no requests and the script has one number to move.
   ========================================================================== */

.tracker {
  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 */
.tracker__head {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem;
  padding-bottom: .875rem;
  border-bottom: 1px solid var(--neutral-200);
}
.tracker__state {
  display: flex; align-items: center; gap: .5rem;
  font-size: .6875rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--primary-700);
}
.tracker__project { font-size: .9375rem; font-weight: 700; color: var(--neutral-900); }
.tracker__client { font-size: .8125rem; color: var(--neutral-500); }
.tracker__week {
  margin-left: auto;
  font-size: .8125rem; color: var(--neutral-500); font-variant-numeric: tabular-nums;
}
.tracker__week b { font-weight: 700; color: var(--neutral-900); }

/* ------------------------------------------------------------ the split */
.tracker__split {
  flex: 1; min-height: 0;
  margin-top: 1rem;
  display: grid; grid-template-columns: 17rem minmax(0, 1fr);
  gap: 1.75rem;
}

/* What is running, and what it has put on today. */
.tracker__rail {
  display: flex; flex-direction: column;
  padding-right: 1.75rem;
  border-right: 1px solid var(--neutral-150);
}

/* The clock. Tabular figures, so the seconds changing does not move the
   minutes beside them. */
.tracker__clock {
  margin: 0;
  font-size: 2.5rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.05;
  color: var(--neutral-900); font-variant-numeric: tabular-nums;
}
.tracker__task { margin: .625rem 0 0; }
.tracker__task b { display: block; font-size: .9375rem; font-weight: 700; color: var(--neutral-900); }
.tracker__task span { display: block; margin-top: .125rem; font-size: .8125rem; color: var(--neutral-500); }

.tracker__today { margin: 1.5rem 0 .5rem; }
.tracker__today b {
  font-size: 1.375rem; font-weight: 800; letter-spacing: -.02em;
  color: var(--neutral-900); font-variant-numeric: tabular-nums;
}
.tracker__today span { display: block; margin-top: .125rem; font-size: .8125rem; color: var(--neutral-500); }

.tracker__bar {
  display: block; height: .5rem;
  border-radius: 999px; background: var(--neutral-100);
  overflow: hidden;
}
.tracker__bar i {
  display: block; height: 100%; width: var(--w, 0%);
  border-radius: inherit; background: var(--primary-500);
}

/* The promise, at the foot of the rail where the eye leaves the column. */
.tracker__note {
  margin: auto 0 0;
  display: flex; align-items: flex-start; gap: .5rem;
  font-size: .75rem; line-height: 1.45; color: var(--neutral-500);
}
.tracker__note .icon { flex: none; margin-top: .125rem; color: var(--neutral-400); }

/* ------------------------------------------------------- the week beside it */
.tracker__list {
  margin: 0; padding: 0; list-style: none;
  min-height: 0;
  display: flex; flex-direction: column; justify-content: center; gap: .25rem;
}
.tracker__row {
  display: grid; grid-template-columns: 10rem minmax(0, 1fr) 6.5rem;
  align-items: center; gap: 1rem;
  padding: .75rem 0;
}
.tracker__row + .tracker__row { border-top: 1px solid var(--neutral-150); }

.tracker__name { font-size: .875rem; font-weight: 700; color: var(--neutral-900); }
.tracker__name span { display: block; font-size: .75rem; font-weight: 400; color: var(--neutral-500); }

.tracker__track {
  display: block; height: 1.5rem;
  border-radius: var(--r-sm); background: var(--neutral-50);
  box-shadow: inset 0 0 0 1px var(--neutral-150);
  overflow: hidden;
}
.tracker__track i {
  display: block; height: 100%; width: var(--w, 0%);
  border-radius: inherit; background: var(--neutral-200);
}
/* The project the timer is on. Solid, because it is the subject; the other
   three are the context it is being read against. */
.tracker__row--on .tracker__track i { background: var(--primary-400); }

.tracker__out { text-align: right; }
.tracker__out b {
  display: block;
  font-size: .9375rem; font-weight: 800; color: var(--neutral-900);
  font-variant-numeric: tabular-nums;
}
.tracker__out span { display: block; font-size: .75rem; color: var(--neutral-500); }

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

@media (max-width: 859px) {
  .tracker { padding: 1.125rem 1.25rem; }
  /* One column. A 17rem rail and four project rows do not both survive a
     700px panel, and the clock is the half a reader came for. */
  .tracker__split { grid-template-columns: minmax(0, 1fr); gap: 1.25rem; }
  .tracker__rail { padding-right: 0; border-right: 0; padding-bottom: 1.25rem; border-bottom: 1px solid var(--neutral-150); }
  .tracker__clock { font-size: 2.125rem; }
  .tracker__today { margin-top: 1.125rem; }
}

@media (max-width: 599px) {
  .tracker { padding: 1rem; }
  /* The name and the hours. A bar 90px wide reads as a smudge, and the
     figure beside it says the same thing exactly. */
  .tracker__row { grid-template-columns: minmax(0, 1fr) 6rem; gap: .75rem; }
  .tracker__track { display: none; }
}

/* --------------------------------------------------------------------------
   One day, taken apart
   --------------------------------------------------------------------------
   Section 04's figure: a working day as one bar, divided by the projects
   inside it, then the same four read down as rows.

   The bar first, because the claim is that the day is already divided
   before anybody asks. The rows under it carry the arithmetic, so nothing
   has to be measured off the picture.
   -------------------------------------------------------------------------- */
.split {
  margin-top: 2.5rem; padding: 1.5rem;
  border: 1px solid var(--neutral-200); border-radius: var(--r-lg);
  background: #fff;
}

.split__head {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--neutral-150);
}
.split__what { font-size: .9375rem; font-weight: 700; color: var(--neutral-900); }
.split__span { font-size: .8125rem; color: var(--neutral-500); font-variant-numeric: tabular-nums; }
.split__total {
  margin-left: auto;
  font-size: .8125rem; color: var(--neutral-500); font-variant-numeric: tabular-nums;
}
.split__total b { font-weight: 700; color: var(--neutral-900); }

/* The day itself. One track, four segments, no gaps: a day has no gaps in
   it, and a gap between the segments would be a claim about missing time. */
.split__bar {
  display: flex;
  margin-top: 1.25rem; height: 3.25rem;
  border-radius: var(--r-sm); overflow: hidden;
  box-shadow: inset 0 0 0 1px var(--neutral-150);
}
.split__seg {
  display: flex; align-items: center;
  width: var(--w, 0%); min-width: 0;
  padding: 0 .75rem;
}
.split__seg b {
  font-size: .75rem; font-weight: 700; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* Four steps of one hue rather than four colours. The day is one thing
   divided, not four things collected. */
.split__seg--a { background: var(--primary-600); }
.split__seg--b { background: var(--primary-500); }
.split__seg--c { background: var(--primary-400); }
.split__seg--d { background: var(--neutral-400); }

.split__rows { margin: .5rem 0 0; padding: 0; list-style: none; }
.split__row {
  display: grid; grid-template-columns: .75rem minmax(0, 1fr) 6rem 4rem;
  align-items: center; gap: .875rem;
  padding: .875rem 0;
}
.split__row + .split__row { border-top: 1px solid var(--neutral-150); }

.split__key { width: .75rem; height: .75rem; border-radius: 3px; }
.split__key--a { background: var(--primary-600); }
.split__key--b { background: var(--primary-500); }
.split__key--c { background: var(--primary-400); }
.split__key--d { background: var(--neutral-400); }

.split__name { font-size: .875rem; font-weight: 700; color: var(--neutral-900); }
.split__name span { display: block; font-size: .75rem; font-weight: 400; color: var(--neutral-500); }
.split__hours {
  text-align: right;
  font-size: .9375rem; font-weight: 800; color: var(--neutral-900);
  font-variant-numeric: tabular-nums;
}
.split__share {
  text-align: right;
  font-size: .8125rem; color: var(--neutral-500); font-variant-numeric: tabular-nums;
}

@media (max-width: 859px) {
  .split { padding: 1.25rem; }
  .split__bar { height: 2.75rem; }
  /* The two narrowest segments cannot hold a word at this width, and a
     label clipped to three letters is worse than the key below. */
  .split__seg--c b,
  .split__seg--d b { display: none; }
}

@media (max-width: 599px) {
  .split__seg b { display: none; }
  .split__row { grid-template-columns: .75rem minmax(0, 1fr) 5rem; }
  /* The share goes. The hours are the figure, and four of them against a
     stated eight-hour day is the same arithmetic. */
  .split__share { display: none; }
}
