/* =====================================================================
   links.lightly-salted.com — the linktree layer only.

   site.css (shared design system) and hub.css (dashofblum's lab-notebook
   skin) do the heavy lifting: palette, mono type, the dot-grid paper and
   the `//` kickers. This file adds only the two things the hub has no
   vocabulary for — the circular portrait and the icon-button grid — and
   it builds both entirely out of hub tokens so the rust accent stays the
   single source of truth.

   Rule inherited from hub.css: DON'T hardcode the accent. Every colour below
   is a var() off the hub. Changing --accent in hub.css restyles this page too
   (darkroom mode included).

   Nothing here overrides site.css layout primitives (.container, .section,
   .page-hero, .kicker, .lede) — those are used as-is.
   ===================================================================== */

/* ---- Hero stack ----------------------------------------------------- */
/* The hub's .page-hero is left-aligned prose; a links page wants a column. */
.links-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--sp-2);
}

/* .kicker is display:inline-flex with a leading `//` via ::before; in a
   centred column the element is centred as a whole instead of stretched. */
.links-hero .kicker { align-self: center; }

.links-hero h1 { margin: 0; }

.links-hero .lede {
  color: var(--muted);
  margin: 0;
  max-width: 30ch;
}

/* ---- Portrait ------------------------------------------------------- */
/* The ring is the accent at low alpha, so it tracks the hub's rust. */
.links-portrait {
  width: clamp(120px, 34vw, 168px);
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 50%;
  margin-bottom: var(--sp-2);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  box-shadow:
    0 0 0 6px color-mix(in srgb, var(--accent) 8%, transparent),
    0 18px 44px color-mix(in srgb, var(--accent) 18%, transparent);
}

/* ---- The link grid -------------------------------------------------- */
/* Explicit column counts, not auto-fit: at 34rem the auto-fit track sizing
   resolved to five columns and orphaned Bluesky onto a second row by itself.
   Six named columns with a width that actually fits them is predictable.
   minmax(0, 1fr) rather than 1fr so a long label ("Instagram") can't push a
   track past its share. */
.links-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--sp-2);
  width: 100%;
  max-width: 40rem;
  margin-top: var(--sp-4);
}

/* Two rows of three on phones — the tiles would be ~50px across otherwise. */
@media (max-width: 640px) {
  .links-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-width: 22rem;
  }
}

/* Squared to 4px like the hub's cards and photographs. */
.links-grid a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  min-height: 84px;
  padding: var(--sp-2) .5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--ink);
  text-decoration: none;
  transition:
    transform var(--speed) var(--ease),
    border-color var(--speed) var(--ease),
    background var(--speed) var(--ease),
    box-shadow var(--speed) var(--ease);
}

.links-grid i {
  font-size: 1.6rem;
  color: var(--accent-ink);
  transition: color var(--speed) var(--ease);
}

.links-grid a:hover,
.links-grid a:focus-visible {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  box-shadow: 0 14px 34px color-mix(in srgb, var(--accent) 16%, transparent);
}

.links-grid a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* The label is the hub's mono, matching the nav and kickers. */
.links-grid .label {
  font-family: var(--font-mono);
  font-size: .78rem;
  letter-spacing: .02em;
  color: var(--muted);
  transition: color var(--speed) var(--ease);
}

.links-grid a:hover .label,
.links-grid a:focus-visible .label { color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  .links-grid a { transition: none; }
  .links-grid a:hover,
  .links-grid a:focus-visible { transform: none; }
}

/* ---- Vertical centring ---------------------------------------------- */
/* A six-link page is short; without this it sits jammed under the top edge. */
#main {
  display: flex;
  align-items: center;
  min-height: 100svh;
}

#main > .page-hero { width: 100%; }
