/* Repeatable pieces: stats, calendar, repo rows, cards, presence. */

/* ── activity stats ── */
.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px; margin-bottom: 16px;
}
.stat {
  border: 1px solid var(--line); padding: 22px 24px; display: grid; gap: 6px;
  border-radius: 4px;
  transition: border-color .35s ease, background .4s ease,
              box-shadow .4s ease, transform .45s cubic-bezier(.16,1,.3,1);
}
.stat:hover {
  border-color: rgba(255,255,255,.16);
  background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.035));
  -webkit-backdrop-filter: blur(16px) saturate(170%);
  backdrop-filter: blur(16px) saturate(170%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.30),
    0 0 0 1px rgba(255,255,255,.05),
    0 14px 34px rgba(0,0,0,.5);
}
.stat span {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--meta);
}
.stat strong {
  font-size: 34px; font-weight: 500; letter-spacing: -.02em; line-height: 1;
  font-variant-numeric: tabular-nums;
}
/* keeps long units ("commits", "days") on the value's single line */
.stat strong .unit {
  font-size: 14px; font-weight: 400; letter-spacing: 0; color: var(--meta);
  margin-left: 5px;
}

/* ── contribution calendar ── */
.cal { border: 1px solid var(--line); padding: 24px; display: grid; gap: 16px; }
.calScroll { overflow-x: auto; padding-bottom: 4px; }
.grid {
  display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 11px);
  gap: 3px; justify-content: start;
}
.grid i { width: 11px; height: 11px; border-radius: 2px; display: block; }
.grid i:hover { outline: 1px solid var(--ink); outline-offset: 1px; }
.calFoot {
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; flex-wrap: wrap;
  font-family: var(--mono); font-size: 11.5px; color: var(--meta);
}
.legend { display: flex; align-items: center; gap: 6px; }
.legend i { width: 11px; height: 11px; border-radius: 2px; display: block; }

/* ── shipped repo rows ── */
.repo {
  position: relative; isolation: isolate;
  display: grid; gap: 12px; padding: 28px 0;
  border-top: 1px solid var(--line); border-radius: 0;
  transition: border-top-color .35s ease,
              background .4s ease,
              box-shadow .4s ease,
              border-radius .4s ease,
              padding .45s cubic-bezier(.16,1,.3,1);
}

/* Liquid glass.
   The blur sits on the ROW, not on a pseudo-element behind it: a
   backdrop-filter pseudo underneath would pull the row's own text into its
   backdrop snapshot and smear it. ::after only paints a cursor-tracked
   specular highlight, which is filter-free and safe under the text.
   On a near-black page the blur alone reads as nothing, so the visible glass
   comes from the gradient fill, a bright top rim, and an outer glow. */
.repo:hover {
  border-top-color: transparent;
  padding: 28px 24px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,.11), rgba(255,255,255,.04));
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  backdrop-filter: blur(18px) saturate(180%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.42),
    inset 0 -1px 0 rgba(255,255,255,.08),
    0 0 0 1px rgba(255,255,255,.10),
    0 24px 60px rgba(0,0,0,.6),
    0 0 70px rgba(255,255,255,.05);
}

/* specular highlight — position comes from --mx/--my in assets/js/hover.js */
.repo::after {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: 16px;
  pointer-events: none;
  background: radial-gradient(300px circle at var(--mx, 50%) var(--my, 50%),
              rgba(255,255,255,.16), transparent 62%);
  opacity: 0; transition: opacity .4s ease;
}
.repo:hover::after { opacity: 1; }

/* .reveal's transition shorthand would otherwise replace the ones above. */
.repo.reveal {
  transition: opacity .75s cubic-bezier(.2,.7,.2,1),
              transform .75s cubic-bezier(.2,.7,.2,1),
              border-top-color .35s ease,
              background .4s ease,
              box-shadow .4s ease,
              border-radius .4s ease,
              padding .45s cubic-bezier(.16,1,.3,1);
}

/* text stays light on the glass; only the meta line lifts slightly */
.repo h2, .repo .repoMeta, .repo p { transition: color .3s ease; }
.repo:hover .repoMeta { color: var(--dim); }

.repoTop {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 24px; flex-wrap: wrap;
}
.repo h2 { margin: 0; font-size: clamp(24px, 3.4vw, 34px); letter-spacing: -.02em; font-weight: 500; }
.repoMeta { font-family: var(--mono); font-size: 12px; color: var(--meta); white-space: nowrap; }
.repo p { margin: 0; max-width: 62ch; font-size: 16px; line-height: 1.5; color: var(--dim); text-wrap: pretty; }
.arrow {
  display: inline-block; margin-left: 14px; opacity: 0;
  transform: translate(-10px, 6px) rotate(-25deg);
  transition: opacity .3s ease .05s, transform .4s cubic-bezier(.16,1,.3,1) .05s;
}
.repo:hover .arrow { opacity: 1; transform: none; }

/* nav + footer links: underline sweeps in from the left */
nav a, .footLinks a { position: relative; }
nav a::after, .footLinks a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: var(--ink);
  transform: scaleX(0); transform-origin: left;
  transition: transform .35s cubic-bezier(.16,1,.3,1);
}
nav a:hover::after, .footLinks a:hover::after { transform: scaleX(1); }

/* ── in-development cards ── */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.card {
  position: relative; isolation: isolate;
  border: 1px solid var(--line); padding: 28px 24px; border-radius: 4px;
  display: grid; gap: 10px; align-content: start;
  transition: border-color .35s ease, background .4s ease, box-shadow .4s ease,
              transform .45s cubic-bezier(.16,1,.3,1);
}
.card:hover {
  border-color: rgba(255,255,255,.16);
  transform: translateY(-4px);
  background: linear-gradient(180deg, rgba(255,255,255,.11), rgba(255,255,255,.04));
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  backdrop-filter: blur(18px) saturate(180%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.40),
    0 0 0 1px rgba(255,255,255,.08),
    0 20px 48px rgba(0,0,0,.6),
    0 0 60px rgba(255,255,255,.045);
}
.card::after {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: 4px;
  pointer-events: none;
  background: radial-gradient(220px circle at var(--mx, 50%) var(--my, 50%),
              rgba(255,255,255,.16), transparent 60%);
  opacity: 0; transition: opacity .4s ease;
}
.card.reveal {
  transition: opacity .75s cubic-bezier(.2,.7,.2,1),
              transform .75s cubic-bezier(.2,.7,.2,1),
              border-color .35s ease, background .4s ease, box-shadow .4s ease;
}
.card:hover::after { opacity: 1; }
.card h3 { margin: 0; font-size: 19px; font-weight: 500; letter-spacing: -.01em; }
.card p { margin: 0; font-size: 14.5px; line-height: 1.5; color: var(--dim); text-wrap: pretty; }

/* ── discord presence ── */
/* Banner sits flush at the card's top edge, fading down into the card so the
   identity row stays readable over it. Only rendered when data.json carries a
   banner hash (Discord needs a bot token for that - see the workflow). */
.pBanner {
  flex: 1 0 100%;
  margin: -24px -24px 0; height: 128px;
  background-size: cover; background-position: center;
  border-radius: 3px 3px 0 0;
  filter: grayscale(1) contrast(1.05) brightness(.75);
  transition: filter .5s ease;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 55%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 0%, #000 55%, transparent 100%);
}
.presence:hover .pBanner { filter: grayscale(0) contrast(1.05) brightness(.85); }

/* Avatar decoration frame - Lanyard returns this live, no token needed.
   Selector is .pAvatar img.pDeco so it outranks .pAvatar img, which would
   otherwise force 56px, a 50% radius (clipping the ornament) and grayscale. */
.pAvatar img.pDeco {
  position: absolute; left: -7px; top: -5px;
  width: 70px; height: 70px;
  border-radius: 0;
  filter: grayscale(1) contrast(1.05);
  pointer-events: none; display: block;
  transition: filter .4s ease;
}
.presence:hover .pAvatar img.pDeco { filter: none; }

/* Both groups hug their content and sit at opposite ends, so the leftover
   width reads as breathing room between them rather than a void trailing off
   the right edge (which is what a stretched 1fr text column produced). */
.presence {
  border: 1px solid var(--line); border-radius: 4px; padding: 24px;
  display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: 24px;
  transition: border-color .35s ease;
}
.presence:hover { border-color: rgba(255,255,255,.14); }

/* ── identity ── */
.pId { display: flex; align-items: center; gap: 16px; min-width: 0; flex: 0 1 auto; }
.pAvatar { position: relative; flex: none; width: 56px; height: 56px; }
.pAvatar img {
  width: 56px; height: 56px; border-radius: 50%; display: block;
  filter: grayscale(1) contrast(1.05); transition: filter .4s ease;
}
.presence:hover .pAvatar img { filter: none; }
/* Status dot. The page is monochrome, so status reads as SHAPE the way
   Discord's own indicators do — colour alone can't carry four states here.
   The mask cuts the glyph out of a solid fill: crescent for idle, bar for
   dnd, ring for offline, solid for online. data-status is set in discord.js. */
.pDot {
  position: absolute; right: -2px; bottom: -2px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--bg);
  display: grid; place-items: center;
}
.pDot::before {
  content: ""; width: 12px; height: 12px; border-radius: 50%;
  background: var(--line2);
  transition: background .4s ease, box-shadow .4s ease;
}

/* Discord's own status colours — the one place the page leaves monochrome,
   because these four hues are the shared convention users already read.
   Shape is kept alongside colour so the state survives greyscale. */
.pDot[data-status="online"]::before {
  background: var(--dc-online);
  box-shadow: 0 0 0 0 rgba(35,165,90,.6);
  animation: dotPulse 2.4s ease-out infinite;
}
@keyframes dotPulse {
  0%   { box-shadow: 0 0 0 0 rgba(35,165,90,.55); }
  70%  { box-shadow: 0 0 0 6px rgba(35,165,90,0); }
  100% { box-shadow: 0 0 0 0 rgba(35,165,90,0); }
}

/* idle — crescent, bitten out by an offset circle */
.pDot[data-status="idle"]::before {
  background: var(--dc-idle);
  -webkit-mask: radial-gradient(circle 8px at 118% 22%, transparent 99%, #000 100%);
  mask: radial-gradient(circle 8px at 118% 22%, transparent 99%, #000 100%);
}

/* dnd — circle with a bar removed */
.pDot[data-status="dnd"]::before {
  background: var(--dc-dnd);
  -webkit-mask: linear-gradient(#000 0 34%, transparent 34% 66%, #000 66% 100%);
  mask: linear-gradient(#000 0 34%, transparent 34% 66%, #000 66% 100%);
}

/* offline — hollow ring, no colour */
.pDot[data-status="offline"]::before {
  background: transparent;
  box-shadow: inset 0 0 0 2.5px var(--dc-offline);
}

@media (prefers-reduced-motion: reduce) {
  .pDot[data-status="online"]::before { animation: none; }
}
.pWho { display: grid; gap: 3px; min-width: 0; }
.pNameRow { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.pName { font-size: 19px; font-weight: 500; letter-spacing: -.01em; }
.pTag {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--meta);
  border: 1px solid var(--line); border-radius: 3px; padding: 2px 5px; flex: none;
}
.pMetaRow { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.pHandle { font-family: var(--mono); font-size: 12px; color: var(--meta); }
.pPlatform {
  font-family: var(--mono); font-size: 11px; color: var(--line3);
}
.pPlatform::before { content: "· "; }
.pBadges { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 5px; }
.pBadge {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--meta);
  border: 1px solid var(--line); border-radius: 100px; padding: 3px 7px;
}
.pCustom {
  font-size: 13.5px; color: var(--dim); margin-top: 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pStatus {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--meta);
  border: 1px solid var(--line); border-radius: 100px;
  padding: 5px 11px; white-space: nowrap; flex: none;
}

/* ── now playing ── */
.pNow {
  display: flex; align-items: center; gap: 18px;
  min-width: 0; flex: 0 1 auto;
}
@media (min-width: 760px) {
  .pNow { border-left: 1px solid var(--line); padding-left: 24px; }
}
.pArt {
  position: relative; flex: none;
  width: 76px; height: 76px; border-radius: 3px; overflow: hidden;
  background: #141414; border: 1px solid var(--line);
  display: grid; place-items: center;
}
.pArt img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  filter: grayscale(1) contrast(1.05); transition: filter .45s ease;
}
.presence:hover .pArt img { filter: none; }
.pGlyph { font-size: 26px; color: var(--line3); line-height: 1; }
/* small activity icon, layered on the big art the way Discord stacks them */
.pArtSmall {
  position: absolute; right: -5px; bottom: -5px;
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid var(--bg); background: #141414;
  object-fit: cover; display: block;
  filter: grayscale(1) contrast(1.05); transition: filter .45s ease;
}
.presence:hover .pArtSmall { filter: none; }

.pNowText { display: grid; gap: 3px; min-width: 0; }
.pKind {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--meta); margin-bottom: 2px;
}
.pTitle {
  font-size: 17px; letter-spacing: -.01em; font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pSub, .pSub2 {
  font-size: 13.5px; color: var(--dim);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pSub2 { color: var(--meta); font-size: 12.5px; }

.pBarWrap { margin-top: 8px; }
.pBar { height: 3px; background: var(--line); border-radius: 100px; overflow: hidden; }
.pBar span {
  display: block; height: 100%; width: 0;
  background: var(--ink); border-radius: 100px;
  transition: width 1s linear;
}
.pTime { font-family: var(--mono); font-size: 11px; color: var(--meta); margin-top: 6px; }
.pLink {
  font-family: var(--mono); font-size: 11px; color: var(--meta);
  margin-top: 4px; justify-self: start;
  border-bottom: 1px solid var(--line); padding-bottom: 1px;
  transition: color .3s ease, border-color .3s ease;
}
.pLink:hover { color: var(--ink); border-bottom-color: var(--ink); }
/* .pArt must not clip the small icon that overhangs its corner */
.pArt { overflow: visible; }
.pArt img#dc-art-img { border-radius: 3px; overflow: hidden; }
