/* Route-loading skeletons. The shell injects one of the .sk-* layouts into
   #loading while a fragment is in flight (see skeletonFor() in index.html);
   each mirrors its route family's real layout so the swap does not shift
   content, and the shimmer runs on the shared tokens so both themes read
   correctly. Blocks are aria-hidden; the container keeps a visually hidden
   "Loading research" line for assistive tech. */

.sk {
  position: relative;
  overflow: hidden;
  border-radius: var(--chaos-radius-sm, 4px);
  background: var(--line, var(--chaos-line));
  opacity: .55;
}

.sk::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, var(--panel, #FFFFFF), transparent);
  opacity: .6;
  animation: sk-shimmer 1.4s ease-in-out infinite;
}

@keyframes sk-shimmer {
  100% { transform: translateX(100%); }
}

@media (prefers-reduced-motion: reduce) {
  .sk::after { animation: none; }
}

.sk-hidden-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Shared shapes */
.sk-line { height: 14px; }
.sk-line-sm { height: 11px; }
.sk-h1 { height: 52px; }
.sk-chip { height: 26px; width: 128px; border-radius: 6px; }
.sk-circle { width: 40px; height: 40px; border-radius: 50%; }
.sk-block { height: 320px; border-radius: var(--chaos-radius-md, 7px); }

/* ── Article family: framed sheet, rail, H1, meta band, TOC + body ───────── */
.sk-article { max-width: 1130px; margin-inline: auto; border-left: 1px solid var(--line); border-right: 1px solid var(--line); background: var(--panel, #FFFFFF); }
.sk-article-rail { display: flex; justify-content: space-between; align-items: center; padding: 20px 40px; border-bottom: 1px solid var(--line); }
.sk-article-rail .sk:first-child { width: 90px; height: 16px; }
.sk-article-rail .sk:last-child { width: 22px; height: 22px; }
.sk-article-head { padding: 48px 40px 40px; border-bottom: 1px solid var(--line); }
.sk-article-head .sk-h1 { max-width: 760px; margin-bottom: 14px; }
.sk-article-head .sk-h1 + .sk-h1 { max-width: 540px; margin-bottom: 26px; }
.sk-article-head .sk-line { max-width: 640px; margin-bottom: 10px; }
.sk-article-band { display: flex; align-items: center; gap: 28px; padding: 18px 40px; border-bottom: 1px solid var(--line); }
.sk-article-band .sk-name { display: flex; flex-direction: column; gap: 8px; }
.sk-article-band .sk-name .sk { width: 140px; }
.sk-article-band .sk-read { margin-left: auto; width: 80px; height: 12px; }
.sk-article-cols { display: grid; grid-template-columns: 200px minmax(0, 1fr); column-gap: clamp(2rem, 5vw, 4rem); padding: 40px clamp(1.5rem, 3vw, 2.75rem) 64px; }
.sk-article-toc { display: flex; flex-direction: column; gap: 16px; }
.sk-article-toc .sk { height: 12px; width: 85%; }
.sk-article-body .sk-line { margin-bottom: 12px; }
.sk-article-body .sk-line:nth-child(3n) { max-width: 82%; }
.sk-article-body .sk-block { margin: 26px 0; }

/* ── Home: kicker, display title, deck, chart band ──────────────────────── */
.sk-home-hero { background: var(--chaos-navy, #0B101C); padding: 56px 30px 40px; }
.sk-home-hero .sk { opacity: 1; background: var(--chaos-navy-card, #182230); }
.sk-home-hero .sk::after { background: linear-gradient(90deg, transparent, var(--chaos-navy-panel, #101828), transparent); opacity: 1; }
.sk-home-kicker { width: 220px; height: 12px; margin-bottom: 26px; }
.sk-home-title { height: 60px; max-width: 460px; margin-bottom: 14px; }
.sk-home-title + .sk-home-title { max-width: 380px; margin-bottom: 28px; }
.sk-home-deck { max-width: 560px; margin-bottom: 10px; }
.sk-home-chart { height: 380px; margin-top: 40px; border-radius: var(--chaos-radius-md, 7px); }

/* ── Dashboard family: header block + row list ──────────────────────────── */
.sk-dash { max-width: 1300px; margin-inline: auto; padding: 44px clamp(1.5rem, 3vw, 2.75rem) 64px; }
.sk-dash-crumb { width: 200px; height: 12px; margin-bottom: 22px; }
.sk-dash-h1 { height: 40px; max-width: 420px; margin-bottom: 16px; }
.sk-dash-deck { max-width: 560px; margin-bottom: 40px; }
.sk-dash-row { display: flex; align-items: center; gap: 24px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.sk-dash-row .sk-circle { width: 28px; height: 28px; flex: none; }
.sk-dash-row .sk-line { flex: 1; max-width: none; }
.sk-dash-row .sk-line-sm { width: 90px; flex: none; }

@media (max-width: 820px) {
  .sk-article-cols { display: block; }
  .sk-article-toc { display: none; }
  .sk-article-rail, .sk-article-head, .sk-article-band { padding-left: 20px; padding-right: 20px; }
  .sk-home-hero { padding: 40px 20px 32px; }
  .sk-home-chart { height: 240px; }
}
