/* ==========================================================================
   TeamTrek — the shape of a day's focus
   --------------------------------------------------------------------------
   The hero figure on the productivity tracking page: one day drawn as the
   blocks of focused work it was actually made of, with the longest unbroken
   stretch called out and the day's totals under it.

   A shape rather than a dashboard. The activity page records the signal --
   input per interval, apps, idle -- and this page is the layer above it:
   what the signal adds up to. Four numbers in four tiles would be a
   dashboard about a day; the day itself is what shows that eight hours and
   eight hours are not the same eight hours.

   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.
   ========================================================================== */

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

/* ------------------------------------------------------------- the band */
.focus__body { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: center; gap: .75rem; }

.focus__band {
  display: flex; gap: 3px;
  height: 5.5rem;
  border-radius: var(--r-md);
  background: var(--neutral-50);
  box-shadow: inset 0 0 0 1px var(--neutral-150);
  padding: 4px;
  overflow: hidden;
}
/* One stretch of the day. The width is the minutes, written into the markup
   as a percentage of 480, so the band adds up to the eight hours the head
   above it claims. */
.focus__seg {
  position: relative;
  flex: 0 0 var(--w);
  min-width: 2px;
  border-radius: var(--r-xs);
  background: var(--seg, var(--neutral-200));
  display: flex; align-items: flex-end;
  overflow: hidden;
  transform-origin: left center;
}
.focus__seg--work  { --seg: var(--primary-500); }
.focus__seg--comms { --seg: var(--neutral-400); }
.focus__seg--meet  { --seg: var(--neutral-700); }
.focus__seg--web   { --seg: var(--primary-200); }
.focus__seg--idle {
  --seg: transparent;
  background: repeating-linear-gradient(135deg,
    var(--neutral-200) 0 5px, var(--neutral-100) 5px 10px);
}

/* The longest unbroken stretch, which is the figure this page cares about
   most. A ring and a label inside it, because a reader should be able to
   find it without reading the totals underneath. */
.focus__seg.is-longest {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--primary-700);
}
.focus__seg b {
  padding: .25rem .4375rem;
  font-size: .6875rem; font-weight: 700; color: #fff;
  white-space: nowrap;
}

/* The hours the band covers. Placed from --at, a percentage of the track,
   so a label and the point it names cannot drift apart as the width
   changes. */
.focus__axis {
  position: relative; display: block; height: 1.0625rem;
  font-size: .75rem; color: var(--neutral-500);
  font-variant-numeric: tabular-nums;
}
.focus__axis b {
  position: absolute; top: 0;
  left: calc(var(--at) * 1%); transform: translateX(-50%);
  font-weight: inherit; white-space: nowrap;
}
.focus__axis b:first-child { transform: none; }
.focus__axis b:last-child { transform: translateX(-100%); }

/* ------------------------------------------------------------ the totals */
/* What the shape comes to. Four figures, because the fifth a reader wants
   is always the one that contradicts the other four. */
.focus__totals {
  flex: none;
  margin: .875rem 0 0; padding: 0; list-style: none;
  padding-top: .875rem;
  border-top: 1px solid var(--neutral-200);
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}
.focus__total b {
  display: block;
  font-size: 1.375rem; font-weight: 800; letter-spacing: -.02em;
  color: var(--neutral-900); font-variant-numeric: tabular-nums;
}
.focus__total span { display: block; margin-top: .125rem; font-size: .8125rem; color: var(--neutral-500); }
/* The one the page is about. */
.focus__total--key b { color: var(--primary-700); }

/* ------------------------------------------------------------- the key */
.focus__key {
  flex: none;
  margin: .75rem 0 0; padding: 0; list-style: none;
  display: flex; flex-wrap: wrap; gap: .375rem 1.25rem;
  font-size: .75rem; color: var(--neutral-500);
}
.focus__key li { display: flex; align-items: center; gap: .4375rem; }
.focus__key i {
  width: 10px; height: 10px; border-radius: 3px;
  background: var(--seg, var(--neutral-300));
}

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

@media (max-width: 859px) {
  .focus { padding: 1.125rem 1.25rem; }
  .focus__band { height: 4.5rem; }
  /* Two across. Four figures in a 700px panel leaves each one 160px, which
     is not enough for "1h 50m" over "longest unbroken block". */
  .focus__totals { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .875rem 1rem; }
  .focus__total b { font-size: 1.125rem; }
}

@media (max-width: 599px) {
  .focus { padding: 1rem; }
  .focus__band { height: 3.75rem; }
  /* The labels inside the blocks go: at this width the longest stretch is
     90px wide and the ring around it says which one it is. */
  .focus__seg b { display: none; }
}

/* --------------------------------------------------------------------------
   Two days, the same hours
   --------------------------------------------------------------------------
   Section 04's figure: two eight-hour days at the same width, one made of
   four long blocks and one of the same total chopped into nineteen.

   Both rows are 480 minutes. That is the section: the timesheet cannot tell
   them apart, and anybody who has worked both knows which one produced
   something.
   -------------------------------------------------------------------------- */
.twodays {
  margin-top: 2.5rem; padding: 1.5rem;
  border: 1px solid var(--neutral-200); border-radius: var(--r-lg);
  background: #fff;
}

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

.twodays__band {
  display: flex; gap: 2px;
  height: 2.5rem;
  border-radius: var(--r-sm);
  background: var(--neutral-50);
  box-shadow: inset 0 0 0 1px var(--neutral-150);
  padding: 3px;
  overflow: hidden;
}
.twodays__seg {
  flex: 0 0 var(--w); min-width: 1px;
  border-radius: 2px;
  background: var(--seg, var(--neutral-300));
}
.twodays__seg--work  { --seg: var(--primary-500); }
.twodays__seg--break { --seg: var(--neutral-300); }

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

@media (max-width: 859px) {
  .twodays { padding: 1.25rem; }
  .twodays__row { grid-template-columns: minmax(0, 1fr) 6rem; row-gap: .5rem; }
  .twodays__band { grid-column: 1 / -1; }
}
