/* ==========================================================================
   polish.css — the craft layer over native Linkita (khalilli.ai family).
   No layout changes: hairline borders, soft hover elevation, quiet motion,
   and accessible focus rings. Light default; dark scoped to `.dark`.
   ========================================================================== */

/* ── Cards: hairline border + soft lift on the ones that link ──────────── */

.block-bg {
  border: 1px solid rgba(0, 0, 0, 0.055);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease;
}
.dark .block-bg {
  border-color: rgba(255, 255, 255, 0.07);
}

.block-bg:has(> a.absolute):hover {
  transform: translateY(-2px);
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.07),
    0 2px 6px rgba(0, 0, 0, 0.04);
}
.dark .block-bg:has(> a.absolute):hover {
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.45),
    0 2px 6px rgba(0, 0, 0, 0.3);
}

/* ── Header: hairline under the blur ───────────────────────────────────── */

header.blur-header,
header.header {
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}
.dark header.blur-header,
.dark header.header {
  border-bottom-color: rgba(255, 255, 255, 0.07);
}

/* ── Compact index rows: full-width hover strip ────────────────────────── */

.row-item {
  border-radius: 8px;
  padding: 5px 10px;
  margin: 0 -10px;
  transition: background-color 140ms ease;
}
.row-item:hover {
  background: rgba(0, 0, 0, 0.045);
}
.dark .row-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

/* ── Marks: slightly quieter at rest, full ink on card hover ───────────── */

img[src*="/thumbs/"] {
  opacity: 0.85;
  transition: opacity 180ms ease;
}
.block-bg:hover img[src*="/thumbs/"] {
  opacity: 1;
}

/* ── Entrance: one quiet rise on load, staggered ───────────────────────── */

@media (prefers-reduced-motion: no-preference) {
  main > * {
    animation: polish-rise 420ms cubic-bezier(0.2, 0.6, 0.2, 1) both;
  }
  main > *:nth-child(2) {
    animation-delay: 40ms;
  }
  main > *:nth-child(3) {
    animation-delay: 80ms;
  }
  main > *:nth-child(4) {
    animation-delay: 120ms;
  }
  main > *:nth-child(5) {
    animation-delay: 160ms;
  }
  main > *:nth-child(n + 6) {
    animation-delay: 200ms;
  }
}
@keyframes polish-rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

/* ── Focus: a real ring, everywhere ────────────────────────────────────── */

a:focus-visible,
button:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
  border-radius: 4px;
}

/* ── Selection ─────────────────────────────────────────────────────────── */

::selection {
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
}
.dark ::selection {
  background: rgba(255, 255, 255, 0.9);
  color: #111;
}
