/* The 27 nakṣatras — index grid and the single-asterism page.
   Layers on the site's optical-glass tokens (--ink, --accent, --gold, the
   .card.glass material). The emblems are inline SVG drawn in currentColor —
   the CSP allows no icon font and no CDN set — so they take the ink of the
   theme they land in and need no second asset. Theme-aware throughout. */

/* ── index head ─────────────────────────────────────────────────────── */
.nk-head { margin: 6px 0 26px; }
.nk-head h1 { margin: 0 0 10px; }
.nk-head h1 .dev { font-weight: 600; color: var(--ink-soft); font-size: .72em; margin-left: 6px; }
.nk-lede {
  max-width: 68ch; margin: 0 0 20px; font-size: 1.02rem; line-height: 1.7;
  color: var(--ink-soft);
}
.nk-stats { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 0; }
.nk-stat { font-size: .84rem; color: var(--ink-soft); }
.nk-stat strong { color: var(--ink); font-variant-numeric: tabular-nums; font-size: 1.05rem; }

/* ── the grid of 27 ─────────────────────────────────────────────────── */
.nk-grid {
  list-style: none; margin: 0; padding: 0; display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(216px, 1fr));
}
.nk-card { padding: 16px 16px 14px; position: relative; }
.nk-card-link { text-decoration: none; display: block; }
/* The whole card is the target — a stretched link over the glass. */
.nk-card-link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }

.nk-emblem-wrap {
  display: block; width: 52px; height: 52px; margin: 0 0 10px;
  color: var(--gold, #b0813d); opacity: .92;
}
.nk-emblem { width: 100%; height: 100%; display: block; }
.nk-card:hover .nk-emblem-wrap { opacity: 1; }

.nk-num {
  position: absolute; top: 14px; right: 15px;
  font-size: .74rem; font-weight: 700; color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}
.nk-card-title {
  display: block; font-size: 1.02rem; font-weight: 700; color: var(--ink);
  line-height: 1.35;
}
.nk-card-title .dev {
  display: block; font-weight: 600; color: var(--ink-soft); font-size: .9rem;
  margin-top: 1px;
}
.nk-card-span {
  margin: 8px 0 0; font-size: .8rem; color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}
.nk-card-meta { margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }

/* ── chips ──────────────────────────────────────────────────────────── */
.nk-chip {
  font-size: .74rem; font-weight: 600; padding: 2px 9px; border-radius: 999px;
  color: var(--ink-soft); border: 1px solid rgba(120, 150, 200, .28);
  background: rgba(255, 255, 255, .28);
}
.nk-chip-lord {
  color: color-mix(in srgb, var(--gold, #b0813d) 82%, var(--ink));
  border-color: color-mix(in srgb, var(--gold, #b0813d) 40%, transparent);
  background: color-mix(in srgb, var(--gold, #b0813d) 8%, transparent);
}
.nk-chip-quiet { color: var(--ink-faint); }
.nk-chip-warn {
  color: color-mix(in srgb, var(--warn, #b06a2c) 80%, var(--ink));
  border-color: color-mix(in srgb, var(--warn, #b06a2c) 42%, transparent);
  background: color-mix(in srgb, var(--warn, #b06a2c) 9%, transparent);
}
.nk-chip-now {
  color: color-mix(in srgb, var(--good, #3f8f5f) 80%, var(--ink));
  border-color: color-mix(in srgb, var(--good, #3f8f5f) 44%, transparent);
  background: color-mix(in srgb, var(--good, #3f8f5f) 9%, transparent);
}

/* the asterism the Moon is standing in right now */
.nk-card.nk-here { outline: 1px solid color-mix(in srgb, var(--good, #3f8f5f) 46%, transparent); }
.nk-here-note {
  margin: 9px 0 0; font-size: .74rem; font-weight: 600;
  color: color-mix(in srgb, var(--good, #3f8f5f) 80%, var(--ink));
}

/* ── sections ───────────────────────────────────────────────────────── */
.nk-sec { margin: 34px 0; }
.nk-sec-h {
  margin: 0 0 12px; font-size: 1.06rem; font-weight: 700; color: var(--ink);
  padding-bottom: 8px; border-bottom: 1px solid rgba(120, 150, 200, .22);
}
.nk-sec-lede {
  max-width: 68ch; margin: 0 0 16px; font-size: .9rem; line-height: 1.7;
  color: var(--ink-soft);
}

/* ── the three grouping tables ──────────────────────────────────────── */
.nk-groups {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.nk-group { padding: 18px; }
.nk-group-h { margin: 0 0 12px; font-size: .96rem; font-weight: 700; color: var(--ink); }
.nk-group-list { margin: 0; }
.nk-group-list dt {
  margin: 12px 0 3px; font-size: .86rem; font-weight: 700; color: var(--ink);
}
.nk-group-list dt:first-child { margin-top: 0; }
.nk-group-gloss { font-weight: 500; color: var(--ink-faint); font-size: .82rem; }
.nk-group-list dd {
  margin: 0; font-size: .84rem; line-height: 1.65; color: var(--ink-soft);
}
.nk-group-list dd a { color: var(--ink-soft); text-decoration-color: rgba(120, 150, 200, .45); }
.nk-group-list dd a:hover { color: var(--accent); }
.nk-group-for {
  display: block; margin-top: 3px; font-size: .78rem; color: var(--ink-faint);
  line-height: 1.6;
}

/* ── citation links ─────────────────────────────────────────────────── */
.nk-cite {
  font-size: .74rem; font-weight: 600; white-space: nowrap;
  color: color-mix(in srgb, var(--accent) 82%, var(--ink));
  text-decoration: none; border-bottom: 1px dotted currentColor;
}
.nk-cite:hover { color: var(--accent); }
.nk-untraced { font-size: .74rem; color: var(--ink-faint); line-height: 1.5; }

/* ── the single-asterism page ───────────────────────────────────────── */
.nk-hero {
  display: flex; gap: 22px; align-items: flex-start; padding: 22px;
  margin: 6px 0 8px;
}
.nk-hero-art {
  flex: 0 0 auto; width: 104px; height: 104px;
  color: var(--gold, #b0813d);
}
.nk-emblem-lg { width: 100%; height: 100%; display: block; }
.nk-hero-txt { min-width: 0; }
.nk-hero-num {
  margin: 0 0 4px; font-size: .76rem; font-weight: 700; color: var(--ink-faint);
  letter-spacing: .06em; font-variant-numeric: tabular-nums;
}
.nk-hero-txt h1 { margin: 0; font-size: 1.7rem; line-height: 1.2; }
.nk-hero-txt h1 .dev { font-weight: 600; color: var(--ink-soft); font-size: .66em; }
.nk-hero-gloss { margin: 6px 0 0; font-size: .92rem; color: var(--ink-soft); font-style: italic; }
.nk-hero-span {
  margin: 8px 0 0; font-size: .9rem; color: var(--ink);
  font-variant-numeric: tabular-nums; font-weight: 600;
}
.nk-hero-chips { margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 7px; }

/* ── the provenance table ───────────────────────────────────────────── */
.nk-table-wrap { overflow-x: auto; }
.nk-table {
  width: 100%; border-collapse: collapse; font-size: .88rem;
}
.nk-table th, .nk-table td {
  text-align: left; padding: 10px 12px; vertical-align: top;
  border-bottom: 1px solid rgba(120, 150, 200, .18);
}
.nk-table thead th {
  font-size: .74rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--ink-faint);
  border-bottom: 1px solid rgba(120, 150, 200, .3);
}
.nk-table tbody th { font-weight: 700; color: var(--ink); white-space: nowrap; }
.nk-table tbody td { color: var(--ink); }
.nk-table tbody tr:last-child th, .nk-table tbody tr:last-child td { border-bottom: 0; }
.nk-table .dev { color: var(--ink-soft); font-weight: 500; }
.nk-sub { display: block; margin-top: 2px; font-size: .8rem; color: var(--ink-soft); }
.nk-note { display: block; margin-top: 5px; font-size: .8rem; line-height: 1.6; color: var(--ink-faint); }
.nk-src { max-width: 24ch; }
.nk-num-cell { font-variant-numeric: tabular-nums; white-space: nowrap; }
.nk-syl { font-weight: 700; }
.nk-pada-table tbody th { font-variant-numeric: tabular-nums; }
.nk-row-warn { background: color-mix(in srgb, var(--warn, #b06a2c) 5%, transparent); }
.nk-pill-warn {
  font-size: .68rem; font-weight: 700; padding: 1px 7px; border-radius: 999px;
  color: color-mix(in srgb, var(--warn, #b06a2c) 82%, var(--ink));
  border: 1px solid color-mix(in srgb, var(--warn, #b06a2c) 40%, transparent);
}

/* ── a cited verse ──────────────────────────────────────────────────── */
.nk-verse { margin: 0; padding: 18px 20px; }
.nk-verse p {
  margin: 0; font-size: 1rem; line-height: 1.75; color: var(--ink);
}
.nk-verse footer { margin-top: 10px; }

/* ── fine print and the pager ───────────────────────────────────────── */
.nk-fine { margin: 10px 0 0; font-size: .78rem; line-height: 1.65; color: var(--ink-faint); max-width: 68ch; }
.nk-fine-warn { color: color-mix(in srgb, var(--warn, #b06a2c) 62%, var(--ink-soft)); }

.nk-pager {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 30px 0 18px; padding-top: 16px;
  border-top: 1px solid rgba(120, 150, 200, .22);
}
.nk-pager-link { text-decoration: none; min-width: 0; }
.nk-pager-next { text-align: right; }
.nk-pager-dir { display: block; font-size: .74rem; font-weight: 600; color: var(--ink-faint); }
.nk-pager-name { display: block; font-size: .95rem; font-weight: 700; color: var(--ink); }
.nk-pager-link:hover .nk-pager-name { color: var(--accent); }
.nk-pager-all { font-size: .82rem; color: var(--ink-soft); white-space: nowrap; }

.nk-basis-sec { margin-bottom: 10px; }
.nk-basis {
  max-width: 74ch; margin: 22px 0 0; font-size: .8rem; line-height: 1.72;
  color: var(--ink-faint);
}

@media (max-width: 640px) {
  .nk-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .nk-card { padding: 13px 13px 12px; }
  .nk-emblem-wrap { width: 42px; height: 42px; }
  .nk-hero { flex-direction: column; gap: 14px; padding: 18px; }
  .nk-hero-art { width: 76px; height: 76px; }
  .nk-hero-txt h1 { font-size: 1.4rem; }
  .nk-table { font-size: .84rem; }
  .nk-table th, .nk-table td { padding: 9px 9px; }
  .nk-src { max-width: none; }
}

/* The one disclosure that has to be legible: where this table and the
   muhūrta page's transcribed translation part company. */
.nk-group-note,
.nk-note-variant {
  display: block; margin: 14px 0 0; padding-top: 12px;
  border-top: 1px solid rgba(120, 150, 200, .2);
  font-size: .76rem; line-height: 1.62; color: var(--ink-faint);
}
.nk-note-variant { margin-top: 8px; max-width: 46ch; }
