/* ==========================================================================
   content.css — composed content blocks shared across pages

   Where components.css holds primitives (button, card, badge, grid), this
   file holds the assembled blocks built from them that appear on more than
   one page: the service list, the clock, project and community cards, the
   about layout, the social hub and the updates list.

   Keeping them here is what lets /projects, /communities, /about, /socials,
   /updates and /status share the homepage's visual language without any of
   them loading homepage-specific CSS.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Service list — homepage status preview and the full status page
   -------------------------------------------------------------------------- */

.services {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  list-style: none;
  padding: 0;
  margin: 0;
}

.service {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: 3.25rem;
  padding: var(--space-3) 0;
}

.service + .service {
  border-top: 1px solid var(--border);
}

.service__main {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  min-width: 0;
}

.service__main .dot {
  margin-top: 0.4rem;
}

.service__text {
  min-width: 0;
}

.service__name {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text);
}

.service__detail {
  margin-top: 0.125rem;
  color: var(--text-mute);
  font-size: var(--fs-xs);
  line-height: var(--lh-snug);
}

/* --------------------------------------------------------------------------
   Clock — homepage hero panel and the full clock page
   -------------------------------------------------------------------------- */

.clock {
  display: block;
}

.clock__time {
  font-family: var(--ff-mono);
  /* Tabular figures stop the clock jittering as the digits change. */
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
  font-size: clamp(2.25rem, 6vw, 3.25rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--text);
}

.clock__date {
  margin-top: var(--space-3);
  color: var(--text-dim);
  font-size: var(--fs-sm);
}

/* --------------------------------------------------------------------------
   Project cards
   -------------------------------------------------------------------------- */

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  gap: var(--space-4);
}

/* On wide screens the grid becomes a fixed four-column field, so a featured
   project can span two columns and a smaller one span a single column. That
   rhythm is what stops the showcase reading as a uniform wall of boxes. */
@media (min-width: 60rem) {
  .projects-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .project-card {
    grid-column: span 1;
  }

  .project-card--featured {
    grid-column: span 2;
  }
}

/* Kind-specific accents, so a community reads differently from a utility. */
.project-card[data-kind='community'] .tile {
  background: rgba(166, 107, 255, 0.12);
  color: #c79bff;
}

.project-card[data-kind='game'] .tile {
  background: rgba(61, 220, 151, 0.12);
  color: var(--ok);
}

.project-card[data-kind='experiment'] .tile {
  background: rgba(247, 185, 85, 0.12);
  color: var(--warn);
}

.project-card--featured .card__title {
  font-size: var(--fs-lg);
}

.project-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

/* --------------------------------------------------------------------------
   Community cards
   -------------------------------------------------------------------------- */

.community-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: var(--space-6);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  background: linear-gradient(155deg, var(--surface-2), var(--surface-1));
  overflow: hidden;
}

.community-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
}

.community-card__head {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
}

.community-card__title {
  font-size: var(--fs-lg);
}

.community-card__role {
  margin-top: var(--space-1);
  color: var(--accent-soft);
  font-family: var(--ff-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.community-card__body {
  flex: 1;
  margin-top: var(--space-4);
  color: var(--text-dim);
  font-size: var(--fs-sm);
}

.community-card__live {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-5);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border);
}

/* Reserved height, so the card does not jump when live data replaces the
   loading skeleton. */
.community-card__count {
  min-height: 1.25rem;
  font-size: var(--fs-sm);
  color: var(--text-dim);
}

.community-card__count.skeleton {
  width: 9rem;
}

.community-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-5);
}

/* --------------------------------------------------------------------------
   About
   -------------------------------------------------------------------------- */

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.about__lead {
  margin-bottom: var(--space-6);
  color: var(--text);
  font-size: var(--fs-lg);
  font-weight: 500;
  line-height: var(--lh-snug);
  text-wrap: balance;
}

.about-highlights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  gap: var(--space-3);
}

.highlight {
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-1);
}

.highlight__icon {
  color: var(--accent-soft);
}

.highlight__label {
  margin-top: var(--space-3);
  font-size: var(--fs-sm);
  font-weight: 600;
}

.highlight__text {
  margin-top: var(--space-1);
  color: var(--text-mute);
  font-size: var(--fs-xs);
  line-height: var(--lh-snug);
}

/* --------------------------------------------------------------------------
   Socials

   One unified block rather than a row of loose boxes: a shared container, a
   shared rhythm, and each platform's colour used only as a small accent.
   -------------------------------------------------------------------------- */

.social-hub {
  padding: clamp(1.25rem, 3vw, 2rem);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  background: var(--surface-1);
}

.social-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: var(--space-3);
}

.social {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-elev);
  transition: border-color var(--t-base) var(--ease), transform var(--t-base) var(--ease),
    background var(--t-base) var(--ease);
}

/* --brand is set per card, from the colour in content.py. */
.social:hover {
  border-color: color-mix(in srgb, var(--brand) 55%, transparent);
  background: var(--surface-2);
  transform: translateY(-2px);
}

.social__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--brand) 16%, transparent);
  color: var(--brand);
}

/* Browsers without color-mix still get a clean, readable card. */
@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .social:hover {
    border-color: var(--border-strong);
  }

  .social__icon {
    background: var(--surface-3);
    color: var(--text);
  }
}

.social__text {
  min-width: 0;
}

.social__name {
  display: block;
  font-size: var(--fs-sm);
  font-weight: 600;
}

.social__handle {
  display: block;
  margin-top: 0.125rem;
  font-family: var(--ff-mono);
  font-size: var(--fs-xs);
  color: var(--text-mute);
  /* A long handle must never widen the card. */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.social__desc {
  margin-top: var(--space-2);
  color: var(--text-mute);
  font-size: var(--fs-xs);
  line-height: var(--lh-snug);
}

/* An account whose URL is not filled in yet. Rendered as a plain <div>, so
   it is not focusable and cannot lead anywhere dead. */
.social--unset {
  opacity: 0.55;
}

.social--unset:hover {
  transform: none;
  border-color: var(--border);
  background: var(--bg-elev);
}

/* --------------------------------------------------------------------------
   Updates
   -------------------------------------------------------------------------- */

.updates {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  list-style: none;
  padding: 0;
  margin: 0;
}

.update {
  display: grid;
  grid-template-columns: minmax(0, 9rem) minmax(0, 1fr);
  gap: var(--space-4) var(--space-6);
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface-1);
}

.update__when {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
}

.update__date {
  font-family: var(--ff-mono);
  font-size: var(--fs-xs);
  color: var(--text-mute);
}

.update__title {
  font-size: var(--fs-md);
}

.update__body {
  margin-top: var(--space-2);
  color: var(--text-dim);
  font-size: var(--fs-sm);
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 64rem) {
  .about-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 40rem) {
  .update {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-3);
  }

  .update__when {
    flex-direction: row;
    align-items: center;
    gap: var(--space-3);
  }
}

/* --------------------------------------------------------------------------
   Dashboard tiles

   The compact icon-plus-label link tiles. Used for the homepage quick
   access row and for the two links at the foot of the About page.
   -------------------------------------------------------------------------- */

.dash {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  gap: var(--space-4);
}

.dash__item {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface-1);
  transition: border-color var(--t-base) var(--ease), background var(--t-base) var(--ease),
    transform var(--t-base) var(--ease);
}

.dash__item:hover {
  border-color: var(--accent-line);
  background: var(--surface-2);
  transform: translateY(-2px);
}

.dash__text {
  min-width: 0;
}

/* These are <span>s inside the tile, so they need to be blockified or the
   title and subtitle run together on one line. */
.dash__title {
  display: block;
  font-size: var(--fs-sm);
  font-weight: 600;
}

.dash__sub {
  display: block;
  margin-top: 0.125rem;
  color: var(--text-mute);
  font-size: var(--fs-xs);
}
