/* ===========================================================
   commits.css — the GitHub-activity additions.
   Loads after style.css and only adds; it overrides nothing.
   Tokens (--cream, --warm, --line, --green, --mono…) come from style.css.
   =========================================================== */

/* ===== SPARKLINE INSIDE THE HERO READOUT ===== */
.readout-spark { margin-top: 0.9rem; padding-top: 0.85rem; border-top: 1px dotted rgba(255, 255, 255, 0.18); }
.readout-spark svg { display: block; width: 100%; height: 42px; }
.readout-spark-foot {
  display: flex; justify-content: space-between; margin-top: 0.45rem;
  font-size: 0.52rem; text-transform: uppercase; letter-spacing: 0.14em; color: rgba(255, 255, 255, 0.3);
}
.readout-row.is-live b { color: var(--green); }

/* ===== COMMIT LOG ===== */
.clog { margin-top: 3.5rem; }
.clog-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  padding-bottom: 0.9rem; border-bottom: 1px solid var(--line);
  font-family: var(--mono); font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.2em; color: var(--dim);
}
.clog-live { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--green); }
.clog-live i { width: 5px; height: 5px; border-radius: 50%; background: var(--green); animation: blink 1.4s infinite; }

.clog-row {
  display: grid; grid-template-columns: 6px 5.2rem 1fr auto; align-items: center; gap: 1.1rem;
  padding: 0.7rem 0; border-bottom: 1px solid var(--line);
  font-family: var(--mono); font-size: 0.74rem; transition: background 0.25s, padding 0.25s;
}
.clog-row:hover { background: rgba(255, 255, 255, 0.025); }
.clog-dot { width: 6px; height: 6px; border-radius: 50%; }
.clog-sha { color: rgba(255, 255, 255, 0.32); letter-spacing: 0.04em; }
.clog-msg {
  font-family: var(--sans); font-size: 0.86rem; color: var(--warm);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: color 0.25s;
}
.clog-row:hover .clog-msg { color: var(--cream); }
.clog-meta { font-size: 0.58rem; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(255, 255, 255, 0.32); white-space: nowrap; }
.clog-foot {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding-top: 0.9rem;
  font-family: var(--mono); font-size: 0.56rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--dim);
}
.clog-foot a { color: rgba(255, 255, 255, 0.6); }
.clog-foot a:hover { color: var(--cream); }

/* scrolling variant: the list drifts until you point at it */
.clog-scroll { height: 268px; overflow: hidden; position: relative; }
.clog-scroll::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, #000, transparent 16%, transparent 84%, #000);
}
.clog-scroll .clog-track { will-change: transform; }

/* ===== COMMIT SKY ===== */
.sky-wrap {
  position: relative; height: 340px; margin-top: 0.5rem;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
#commit-sky { position: absolute; inset: 0; display: block; width: 100%; height: 100%; touch-action: pan-y; }
.sky-hint {
  position: absolute; right: 0; bottom: 0.8rem; pointer-events: none;
  font-family: var(--mono); font-size: 0.55rem; letter-spacing: 0.2em; text-transform: uppercase; color: rgba(255, 255, 255, 0.28);
}
.sky-tip {
  position: absolute; z-index: 4; pointer-events: none; opacity: 0; transition: opacity 0.18s;
  transform: translate(-50%, -175%); white-space: nowrap;
  padding: 0.4rem 0.6rem; border: 1px solid rgba(255, 255, 255, 0.16); background: rgba(8, 8, 10, 0.94);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.06em; color: var(--cream);
}
.sky-tip.on { opacity: 1; }
.sky-tip b { color: var(--green); font-weight: 400; }

.sky-caption { display: flex; gap: 3rem; flex-wrap: wrap; margin-top: 1.6rem; }
.sky-caption .label { margin-bottom: 0.35rem; }
.sky-caption .value { font-family: var(--mono); font-size: 1.05rem; color: var(--cream); font-variant-numeric: tabular-nums; }
.sky-caption .value.green { color: var(--green); }
.sky-note { margin-top: 1.4rem; font-size: 0.85rem; color: var(--dim); max-width: 44rem; }

/* how fresh the data is, said out loud rather than implied by a "live" pip */
.sync {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-family: var(--mono); font-size: 0.78em; letter-spacing: 0.04em; color: var(--green);
  border-bottom: 1px dotted rgba(74, 222, 128, 0.35); cursor: help;
}
.sync::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; animation: blink 1.4s infinite; }
.sync.stale { color: #ffaa2e; border-bottom-color: rgba(255, 170, 46, 0.35); }
.sync.stale::before { animation: none; }

/* ===== RAIN BAND (the Matrix idea, in the site's palette) ===== */
/* the band gets its own air above the heading, so the rain never sits behind text */
.has-rain { position: relative; padding-top: 15rem; }
.has-rain > *:not(.rain-band) { position: relative; z-index: 1; }
.rain-band {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%); z-index: 0;
  width: 100vw; height: 300px; pointer-events: none; overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 22%, #000 55%, transparent);
  mask-image: linear-gradient(180deg, transparent, #000 22%, #000 55%, transparent);
}
#commit-rain { display: block; width: 100%; height: 100%; opacity: 0.55; }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .sky-wrap { height: 280px; }
  .sky-caption { gap: 1.5rem 2.5rem; }
  .clog-row { grid-template-columns: 6px 1fr; gap: 0.8rem; row-gap: 0.25rem; }
  .clog-sha { display: none; }
  .clog-meta { grid-column: 2; }
  .rain-band { height: 240px; }
  .has-rain { padding-top: 11rem; }
}
/* style.css hides the 4th nav link on small screens, which was Stack. Adding
   Commits before it shifts that rule onto the new link, so name them instead. */
@media (max-width: 520px) {
  .nav-links a[data-nav="commits"] { display: block; }
  .nav-links a[data-nav="stack"] { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .clog-live i { animation: none; }
  .rain-band { display: none; }
}
