/* ==========================================================================
   TeamTrek — the tracker beside the editor
   --------------------------------------------------------------------------
   The IT and tech services hero. The page's claim is a tracker light enough
   to run beside an IDE, and the day-feed card that used to sit here showed
   hours without showing that. This shows it: an editor with TeamTrek docked
   over the corner of it, counting.

   Nothing here is a screenshot. The editor is rules and blocks -- a file
   list, a tab strip, lines of muted bars with one caret on them -- because a
   picture of somebody else's code is a picture, and it would be stale the
   day the screenshot was taken.

   It keeps the footprint the feed had, 1056x484 at 1280px wide, so the hero
   and the fold stay where they were.
   ========================================================================== */
.ide {
  position: relative;
  display: grid; grid-template-rows: auto minmax(0, 1fr);
  /* The same box as the day feed on the activity tracking page: 66rem wide,
     centred in the figure, 484px tall at every width. The two heroes are
     the same component in two forms, and a reader who moves between the
     pages should not feel the panel resize under them.

     484, not the feed's 484.31: that fraction is whatever eight rows of a
     list happened to add up to, and it would drift the day that list gains
     a row. A third of a pixel is not a measurement. */
  width: 100%; max-width: 66rem; margin-inline: auto;
  height: 484px;
  border: 1px solid var(--neutral-200); border-radius: var(--r-xl);
  background: #fff;
  /* The feed's shadow, for the feed's reason: 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);
  overflow: hidden;
  font-size: .875rem;
}

/* ---------------------------------------------------------------- tab strip */
.ide__bar {
  display: flex; align-items: center; gap: .75rem;
  padding: .625rem .875rem;
  border-bottom: 1px solid var(--neutral-150);
  background: var(--neutral-50);
}
.ide__dots { display: flex; gap: .375rem; }
.ide__dots i {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--neutral-200);
}
.ide__tabs { display: flex; gap: .25rem; min-width: 0; }
.ide__tab {
  display: inline-flex; align-items: center; gap: .4375rem;
  padding: .3125rem .625rem;
  border-radius: var(--r-xs);
  font-size: .75rem; color: var(--neutral-500);
  white-space: nowrap;
  transition: background-color var(--dur-ui) var(--ease-ui),
              color var(--dur-ui) var(--ease-ui);
}
.ide__tab.is-on { background: #fff; color: var(--neutral-900); font-weight: 700; box-shadow: inset 0 0 0 1px var(--neutral-200); }
.ide__tab i {
  width: 6px; height: 6px; border-radius: 1px;
  background: var(--neutral-300);
}
.ide__tab.is-on i { background: var(--primary-500); }

/* The branch, at the far end, where an editor puts it. */
.ide__branch {
  margin-left: auto; display: inline-flex; align-items: center; gap: .375rem;
  font-size: .75rem; color: var(--neutral-500);
  white-space: nowrap;
}
.ide__branch .icon { width: 13px; height: 13px; color: var(--neutral-400); }

/* ------------------------------------------------------------------- body */
.ide__body { display: grid; grid-template-columns: 12rem minmax(0, 1fr) 3.5rem; min-height: 0; }

.ide__files {
  padding: .875rem .75rem 2.5rem;
  border-right: 1px solid var(--neutral-150);
  background: var(--neutral-25);
  overflow: hidden;
  /* A project is longer than the window. The list fades at the cut rather
     than ending on half a row, which is what a scrolled pane looks like. */
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 3rem), transparent 100%);
          mask-image: linear-gradient(to bottom, #000 calc(100% - 3rem), transparent 100%);
}
.ide__filehead {
  padding: 0 .375rem .5rem;
  font-size: .625rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--neutral-400);
}
.ide__file {
  display: flex; align-items: center; gap: .4375rem;
  padding: .25rem .375rem;
  border-radius: var(--r-xs);
  font-size: .75rem; color: var(--neutral-600);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ide__file i {
  flex: none; width: 5px; height: 5px; border-radius: 1px;
  background: var(--neutral-300);
}
.ide__file.is-on { background: var(--primary-50); color: var(--primary-900); font-weight: 700; }
.ide__file.is-on i { background: var(--primary-600); }
.ide__file--nest { padding-left: 1.25rem; }
.ide__file--nest2 { padding-left: 2.25rem; }

/* The code. Rows of bars rather than letters: the shape of code, which is
   what it is doing here, without pretending to be a particular file. */
.ide__code {
  position: relative;
  /* The status bar is drawn over the bottom of the window, so the page of
     code ends above it rather than running under it. */
  padding: .75rem .25rem 3rem 0;
  display: grid; align-content: start; gap: .375rem;
  overflow: hidden;
  /* A file is longer than the window it is open in. The page fades where it
     is cut rather than ending on half a line. */
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 3.5rem), transparent 100%);
          mask-image: linear-gradient(to bottom, #000 calc(100% - 3.5rem), transparent 100%);
}

/* A line: its number in the gutter, then its tokens. The gutter is a column
   of its own so every line's tokens start on the same vertical, which is
   what makes a page of bars read as code rather than as a chart. */
.ide__line {
  display: grid; grid-template-columns: 2.75rem minmax(0, 1fr);
  align-items: center; gap: .625rem;
  min-height: 11px;
}
.ide__line > b {
  text-align: right;
  font-size: .625rem; font-weight: 500; color: var(--neutral-300);
  font-variant-numeric: tabular-nums;
}
.ide__toks { display: flex; align-items: center; gap: .375rem; min-width: 0; }
.ide__toks > span {
  height: 7px; border-radius: 2px;
  background: var(--neutral-150);
}
.ide__toks > span.k { background: var(--primary-100); }   /* a keyword */
.ide__toks > span.s { background: #E7EEF1; }              /* a string */
.ide__line--indent .ide__toks { padding-left: 1.5rem; }
.ide__line--indent2 .ide__toks { padding-left: 3rem; }

/* The three lines the open pull request touched. A tinted band and one mark
   in the gutter -- the same thing a diff shows, at this size. */
.ide__line--add { background: rgba(32, 183, 166, .07); }
.ide__line--cut { background: rgba(192, 57, 43, .06); }
.ide__line--add > b::after,
.ide__line--cut > b::after {
  content: "+"; margin-left: .25rem; font-weight: 700; color: var(--primary-600);
}
.ide__line--cut > b::after { content: "−"; color: #C0392B; }

/* The minimap, down the right edge where an editor keeps it: the same lines
   at a twelfth of the size. It costs nothing to draw and it is the detail
   that makes the panel read as an editor rather than as a list of bars. */
.ide__map {
  display: grid; align-content: start; gap: 3px;
  padding: 1rem .75rem;
  border-left: 1px solid var(--neutral-150);
  background: var(--neutral-25);
  overflow: hidden;
}
.ide__map > span { height: 3px; border-radius: 1px; background: var(--neutral-200); }
/* The same two marks the gutter carries, so the minimap agrees with the page
   it is a map of. */
.ide__map > span.is-add { background: var(--primary-300); }
.ide__map > span.is-cut { background: #E8B4AE; }

/* The caret, on the line being written. It is the only thing in the editor
   that moves on its own, and it blinks the way a caret blinks. */
.ide__caret {
  flex: none;
  width: 2px; height: 13px; border-radius: 1px;
  background: var(--primary-600);
}
@media (prefers-reduced-motion: no-preference) {
  .ide__caret { animation: tt-caret 1.06s step-end infinite; }
}

/* -------------------------------------------------------------- the tracker */
/* Docked over the editor's corner, the way the real thing sits: small enough
   to leave the work visible, close enough to be one click away. */
.ide__pill {
  /* Clear of the status bar along the bottom: the tracker sits over the
     code, not over the day's totals. */
  position: absolute; right: 1rem; bottom: 3.25rem; z-index: 2;
  /* Wide enough for the longest task the editor cycles through --
     "Atlas API - PR #482 - rate limiting" beside its client -- which
     16.5rem cut six pixels short of. */
  width: 18rem;
  padding: .75rem .875rem;
  border: 1px solid var(--neutral-200); border-radius: var(--r-md);
  background: rgba(255, 255, 255, .92);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  box-shadow: 0 12px 28px rgba(16, 42, 42, .14);
}
.ide__pill-top { display: flex; align-items: center; gap: .5rem; }
.ide__clock {
  font-size: 1.125rem; font-weight: 800; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums; color: var(--neutral-900);
}

/* The readings, arriving from the right: the same twelve-bar window the day
   feed used, at the size a docked window can carry. */
.ide__spark { margin-left: auto; display: flex; align-items: flex-end; gap: 2px; height: 18px; }
.ide__spark > span {
  width: 4px; border-radius: 1px;
  background: var(--primary-200);
  transition: height var(--dur-ui) var(--ease-brand),
              background-color var(--dur-ui) var(--ease-ui);
}
.ide__spark > span:last-child { background: var(--primary-600); }

.ide__task {
  margin-top: .5rem; padding-top: .5rem;
  border-top: 1px solid var(--neutral-150);
  display: flex; align-items: center; gap: .375rem;
  font-size: .75rem; color: var(--neutral-600);
  white-space: nowrap; overflow: hidden;
}
/* When a task name is longer than the dock, the name is what gives way --
   not the client beside it, which is one short word and the thing that
   says whose work this is. An ellipsis says a name was shortened; the
   hard clip this had said nothing, and stopped mid-letter. */
.ide__task > [data-ide-task] {
  min-width: 0; overflow: hidden; text-overflow: ellipsis;
}
.ide__task b { font-weight: 700; color: var(--neutral-900); }
.ide__task i { font-style: normal; color: var(--neutral-300); }
.ide__client { margin-left: auto; flex: none; color: var(--neutral-500); }

/* What changed, when the tracker follows the editor to another task. A short
   lift, once, so the eye is told where to look and nothing keeps moving. */
@media (prefers-reduced-motion: no-preference) {
  .ide__pill.is-moved { animation: ide-nudge .5s var(--ease-brand); }
}
@keyframes ide-nudge {
  0%   { transform: none; }
  35%  { transform: translateY(-4px); box-shadow: 0 18px 34px rgba(16, 42, 42, .18); }
  100% { transform: none; }
}

/* The totals, along the bottom of the editor: what the day holds so far,
   which is the other half of the claim. */
.ide__status {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 1;
  display: flex; align-items: center; gap: 1.25rem;
  padding: .5rem 1rem;
  border-top: 1px solid var(--neutral-150);
  background: #fff;
  font-size: .75rem; color: var(--neutral-500);
}
.ide__status b { font-weight: 700; color: var(--neutral-900); font-variant-numeric: tabular-nums; }
.ide__status span { display: inline-flex; align-items: center; gap: .375rem; }
.ide__status .ide__idle { margin-left: auto; }

/* ------------------------------------------------------------------ small */
@media (max-width: 859px) {
  /* The height holds, as the feed's does: what goes is what a narrow window
     cannot hold -- the minimap first, then the file list -- not the panel's
     share of the screen. */
  .ide__body { grid-template-columns: 9.5rem minmax(0, 1fr); }
  .ide__map { display: none; }
  /* 16rem still cut the longest task by fourteen pixels at 768. The
     editor has 689px here, so the dock can afford the rest. */
  .ide__pill { width: 17.5rem; }
}

@media (max-width: 599px) {
  /* The file list goes next: on a phone the editor has room
     for the code or for its index, and the tracker is docked over the code. */
  .ide__files { display: none; }
  .ide__body { grid-template-columns: minmax(0, 1fr); }
  .ide__pill { right: .75rem; left: .75rem; bottom: .75rem; width: auto; }  /* the status bar is gone here */
  .ide__status { display: none; }
  .ide__branch { display: none; }
}
