/* ==========================================================================
   WILDCARDLABS — RESEARCH LIBRARY (LIGHT, v3)
   Path: public/wildcardlabs.app/frontend/home/subpages/research/research.css

   Same vocabulary as the public entry page, so the two read as one flow:
   - Slim Sora display type over quiet system UI text.
   - Glass plates with a coloured halo for covers and avatars.
   - Hairline section heads with a lit sky tick, ruled rows on a spine.
   - Ambient light, engineering grid and one soft light that follows the pointer.

   Everything is scoped under .wlr / .wlr-* so it can sit next to public.css
   inside the SPA without either sheet touching the other.
   ========================================================================== */

body.wl-research-body { margin: 0; background: #fbfcfe; }
html { -webkit-text-size-adjust: 100%; }

.wlr-mount { display: contents; }

/* ---------- Tokens + shell ---------- */
.wlr {
  --safe-top: env(safe-area-inset-top, 0px);

  --bg-base: #fbfcfe;
  --bg-surface: #ffffff;
  --bg-tint: #f3f7fc;

  --text-main: #0b1220;
  --text-muted: #475569;
  --text-dim: #64748b;

  --line: rgba(11, 18, 32, .08);
  --line-2: rgba(11, 18, 32, .16);

  --wl-sky: #0ea5e9;
  --wl-blue: #2563eb;
  --wl-indigo: #6366f1;

  --status-green: #059669;
  --status-yellow: #d97706;
  --status-red: #dc2626;

  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Sora", var(--font-ui);
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --ease: cubic-bezier(.2, .7, .2, 1);
  --maxw: 1040px;
  --gap-section: clamp(56px, 9vw, 112px);

  position: relative; isolation: isolate;
  flex: 1 1 auto;
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column;
  background: var(--bg-base);
  color: var(--text-main);
  font-family: var(--wl-font-frontend, var(--font-ui));
  font-size: 14px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

/* zero-specificity reset so component rules always win */
:where(.wlr, .wlr *, .wlr *::before, .wlr *::after) { box-sizing: border-box; margin: 0; padding: 0; }
.wlr a { color: inherit; text-decoration: none; }
.wlr button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.wlr [hidden] { display: none !important; }
.wlr button:focus-visible, .wlr a:focus-visible, .wlr input:focus-visible {
  outline: 2px solid var(--wl-sky); outline-offset: 3px; border-radius: 8px;
}

/* Inside the SPA on desktop, #app is a fixed-height viewport: the journal scrolls itself. */
@media (min-width: 901px) {
  body.is-spa-subpage .wlr { height: 100%; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(11, 18, 32, .14) transparent; }
}

/* ---------- Ambient light ---------- */
.wlr-ambient {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden;
}
.wlr-ambient::before {
  content: ""; position: absolute; inset: -10%;
  background:
    radial-gradient(60% 45% at 50% -8%, rgba(14, 165, 233, .20), transparent 70%),
    radial-gradient(40% 35% at 6% 96%, rgba(37, 99, 235, .09), transparent 70%),
    radial-gradient(35% 30% at 96% 68%, rgba(99, 102, 241, .09), transparent 70%);
  animation: wlrDrift 32s ease-in-out infinite alternate;
}
.wlr-ambient::after {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px; opacity: .5;
  -webkit-mask-image: radial-gradient(ellipse 70% 50% at 50% 0%, #000 10%, transparent 75%);
          mask-image: radial-gradient(ellipse 70% 50% at 50% 0%, #000 10%, transparent 75%);
}
@keyframes wlrDrift {
  from { transform: translate3d(-1.5%, 0, 0) scale(1); }
  to   { transform: translate3d(1.5%, 1%, 0) scale(1.04); }
}
.wlr-pointer {
  position: fixed; left: 0; top: 0; z-index: 1; pointer-events: none;
  width: 560px; height: 560px; margin: -280px 0 0 -280px;
  background: radial-gradient(closest-side, rgba(14, 165, 233, .11), transparent);
  opacity: 0; transition: opacity .6s; will-change: transform;
}
.wlr-pointer.on { opacity: 1; }
@media (hover: none) { .wlr-pointer { display: none; } }

/* ---------- Layout ---------- */
.wlr-wrap {
  position: relative; z-index: 2;
  width: 100%; max-width: var(--maxw); margin: 0 auto; flex: 1 0 auto;
  padding: 0 20px 56px;
  display: flex; flex-direction: column;
  gap: var(--gap-section);
}
.wlr-main { display: flex; flex-direction: column; gap: var(--gap-section); }
.wlr-view { display: flex; flex-direction: column; gap: var(--gap-section); }
.wlr-view > section { scroll-margin-top: calc(84px + var(--safe-top)); }

/* ---------- Shared bits ---------- */
.wlr-k {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase; color: var(--text-muted);
}
.wlr-dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%; flex: none;
  background: var(--text-dim);
}
.wlr-dot-live { background: var(--status-green); box-shadow: 0 0 0 3px rgba(5, 150, 105, .14), 0 0 10px rgba(5, 150, 105, .55); }

.wlr-sec-head {
  position: relative;
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding-top: 24px; margin-bottom: 26px;
}
.wlr-sec-head::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, var(--line-2), var(--line) 55%, transparent);
}
.wlr-sec-head::after {
  content: ""; position: absolute; top: -1px; left: 0; width: 30px; height: 2px;
  background: var(--wl-sky); box-shadow: 0 0 14px 2px rgba(14, 165, 233, .4);
}
.wlr-sec-head h2 { font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--text-muted); }
.wlr-sec-meta { font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); text-align: right; }

.wlr-sec-title {
  max-width: 20ch; text-wrap: balance;
  font-family: var(--font-display); font-weight: 200;
  font-size: clamp(1.7rem, 4.6vw, 2.6rem); letter-spacing: -.04em; line-height: 1.1;
  margin-bottom: 28px;
}
.wlr-sec-title em { font-style: normal; font-weight: 300; color: var(--wl-sky); }

.wlr-tag {
  display: inline-block;
  font-family: var(--font-mono); font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--wl-sky); padding: 3px 8px; border-radius: 4px; white-space: nowrap;
  box-shadow: inset 0 0 0 1px rgba(14, 165, 233, .35); background: rgba(14, 165, 233, .05);
}

/* ---------- Buttons ---------- */
.wlr-btn-primary, .wlr-btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 12px 24px; border-radius: 999px; font-size: 13.5px; font-weight: 500;
  transition: background .2s, box-shadow .2s, transform .2s, color .2s;
}
.wlr-btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--wl-sky), var(--wl-blue));
  box-shadow: 0 10px 28px -8px rgba(14, 165, 233, .65), inset 0 0 0 1px rgba(255, 255, 255, .25);
}
.wlr-btn-primary:hover { box-shadow: 0 14px 36px -8px rgba(14, 165, 233, .85), inset 0 0 0 1px rgba(255, 255, 255, .35); transform: translateY(-1px); }
.wlr-btn-ghost { color: var(--text-main); box-shadow: inset 0 0 0 1px var(--line-2); background: rgba(255, 255, 255, .6); }
.wlr-btn-ghost:hover { color: var(--wl-sky); background: rgba(14, 165, 233, .05); box-shadow: inset 0 0 0 1px rgba(14, 165, 233, .55), 0 0 22px rgba(14, 165, 233, .14); }
.wlr-btn-primary:active, .wlr-btn-ghost:active { transform: scale(.98); }
.wlr-btn-sm { padding: 8px 16px; font-size: 12.5px; }
.wlr-arrow { transition: transform .3s var(--ease); flex: none; }
.wlr-btn-primary:hover .wlr-arrow, .wlr-btn-ghost:hover .wlr-arrow, .wlr-enter:hover .wlr-arrow { transform: translateX(3px); }
.wlr-back:hover .wlr-arrow { transform: translateX(-3px); }

/* ---------- Top bar ---------- */
.wlr-bar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin: 0 -20px; padding: calc(12px + var(--safe-top)) 20px 12px;
  background: linear-gradient(180deg, rgba(251, 252, 254, .94), rgba(251, 252, 254, .72));
  backdrop-filter: blur(16px) saturate(1.2); -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}
.wlr-bar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(14, 165, 233, .5) 30%, rgba(14, 165, 233, .5) 70%, transparent);
  opacity: .5; pointer-events: none;
}
.wlr-brand { display: flex; align-items: center; gap: 10px; min-height: 40px; }
.wlr-brand-mark {
  width: 12px; height: 12px; border-radius: 50%; background: var(--wl-sky);
  box-shadow: 0 0 0 4px rgba(14, 165, 233, .14), 0 0 16px 2px rgba(14, 165, 233, .6);
  animation: wlrBreath 4.5s ease-in-out infinite;
}
@keyframes wlrBreath { 50% { box-shadow: 0 0 0 6px rgba(14, 165, 233, .09), 0 0 24px 4px rgba(14, 165, 233, .75); } }
.wlr-brand-name { font-family: var(--font-display); font-size: 1.08rem; font-weight: 300; letter-spacing: -.02em; line-height: 1; }
.wlr-brand-name span { font-weight: 600; color: var(--wl-sky); }
.wlr-brand-section {
  margin-left: 4px; padding-left: 12px; border-left: 1px solid var(--line-2);
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--text-dim);
}

.wlr-links { display: flex; gap: 4px; }
.wlr-links button {
  padding: 8px 12px; border-radius: 10px; font-size: 13px; font-weight: 500; color: var(--text-dim);
  transition: color .2s, background .2s;
}
.wlr-links button:hover { color: var(--text-main); background: rgba(11, 18, 32, .05); }

.wlr-enter {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-radius: 999px; font-size: 12.5px; font-weight: 500; color: var(--wl-sky);
  background: rgba(14, 165, 233, .06);
  box-shadow: inset 0 0 0 1px rgba(14, 165, 233, .55);
  transition: background .2s, box-shadow .2s, color .2s;
}
.wlr-enter:hover { color: #fff; background: var(--wl-sky); box-shadow: inset 0 0 0 1px var(--wl-sky), 0 0 22px rgba(14, 165, 233, .35); }

.wlr-progress {
  position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; z-index: 1; pointer-events: none;
  opacity: 0; transition: opacity .3s;
}
.wlr-progress i {
  display: block; height: 100%; transform: scaleX(0); transform-origin: left;
  background: var(--wl-sky); box-shadow: 0 0 12px 1px rgba(14, 165, 233, .6);
}
.wlr.is-reading .wlr-progress { opacity: 1; }

@media (max-width: 720px) { .wlr-links { display: none; } }

/* ---------- Hero ---------- */
.wlr-hero {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  align-items: center; gap: clamp(28px, 6vw, 72px);
  padding-top: clamp(40px, 8vw, 88px);
}
.wlr-hero-title {
  margin-top: 20px; max-width: 15ch; text-wrap: balance;
  font-family: var(--font-display); font-weight: 200;
  font-size: clamp(2.4rem, 7vw, 4.2rem); line-height: 1.04; letter-spacing: -.05em;
  color: var(--text-main);
}
.wlr-hero-title em {
  font-style: normal; font-weight: 300;
  background: linear-gradient(120deg, var(--wl-sky), var(--wl-blue) 60%, var(--wl-indigo));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 22px rgba(14, 165, 233, .3));
}
.wlr-lede {
  margin-top: clamp(16px, 2.6vw, 24px); max-width: 52ch;
  font-size: clamp(14px, 1.7vw, 16px); line-height: 1.7; color: var(--text-muted);
  text-wrap: pretty;
}
.wlr-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: clamp(22px, 4vw, 34px); }

.wlr-stats {
  list-style: none; display: flex; flex-wrap: wrap; gap: 8px clamp(18px, 4vw, 34px);
  margin-top: clamp(26px, 4.4vw, 42px); padding-top: 22px; border-top: 1px solid var(--line);
}
.wlr-stats li { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--text-dim); }
.wlr-stats b {
  font-family: var(--font-display); font-weight: 300; font-size: 1.3rem; letter-spacing: -.02em;
  color: var(--text-main); font-variant-numeric: tabular-nums;
}

.wlr-hero-side { display: flex; flex-direction: column; align-items: center; gap: 22px; justify-self: center; width: min(100%, 380px); }
.wlr-stage {
  position: relative; width: 100%; aspect-ratio: 1;
  display: grid; place-items: center;
}
.wlr-orbit {
  position: absolute; border-radius: 50%;
  box-shadow: inset 0 0 0 1px var(--line);
  animation: wlrSpin 40s linear infinite;
}
.wlr-orbit::after {
  content: ""; position: absolute; top: -3.5px; left: 50%; margin-left: -3.5px;
  width: 7px; height: 7px; border-radius: 50%; background: var(--wl-sky);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, .15), 0 0 14px 2px rgba(14, 165, 233, .7);
}
.wlr-orbit--1 { inset: 0; }
.wlr-orbit--2 { inset: 13%; animation-duration: 28s; animation-direction: reverse; }
.wlr-orbit--2::after { background: var(--wl-blue); box-shadow: 0 0 0 3px rgba(37, 99, 235, .14), 0 0 14px 2px rgba(37, 99, 235, .6); }
.wlr-orbit--3 { inset: 26%; animation-duration: 20s; }
.wlr-orbit--3::after { background: var(--wl-indigo); box-shadow: 0 0 0 3px rgba(99, 102, 241, .14), 0 0 14px 2px rgba(99, 102, 241, .6); }
@keyframes wlrSpin { to { transform: rotate(360deg); } }

.wlr-feature {
  position: relative; z-index: 1; display: block;
  width: 42%; aspect-ratio: 1;
  transition: transform .45s var(--ease);
}
.wlr-feature .wlr-plate { width: 100%; height: 100%; }
.wlr-feature .wlr-halo { inset: -42%; filter: blur(26px) saturate(1.5); opacity: .55; border-radius: 40%; animation: wlrHalo 5s ease-in-out infinite; }
.wlr-feature .wlr-plate-face { border-radius: 26%; box-shadow: inset 0 0 0 1px rgba(11, 18, 32, .1), 0 26px 50px -18px rgba(14, 165, 233, .55), 0 6px 14px -6px rgba(11, 18, 32, .18); }
.wlr-feature .is-logo svg { width: 62%; height: 62%; display: block; position: relative; z-index: 1; }
.wlr-feature .wlr-plate-face.is-mono span { font-size: clamp(1.8rem, 7vw, 3.2rem); }
@keyframes wlrHalo { 50% { opacity: .35; transform: scale(1.1); } }
@media (hover: hover) { a.wlr-feature:hover { transform: scale(1.05); } }

.wlr-cap {
  display: block; width: 100%; max-width: 320px; padding-top: 18px; position: relative;
}
.wlr-cap::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: var(--line-2); }
.wlr-cap::after {
  content: ""; position: absolute; top: -1px; left: 0; width: 100%; height: 1px;
  background: var(--wl-sky); box-shadow: 0 0 12px rgba(14, 165, 233, .6);
  transform: scaleX(0); transform-origin: left; transition: transform .6s var(--ease);
}
.wlr-cap:hover::after { transform: scaleX(1); }
.wlr-cap-title {
  display: block; margin-top: 10px;
  font-family: var(--font-display); font-weight: 300; font-size: 1.05rem; letter-spacing: -.02em; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.wlr-cap-date { display: block; margin-top: 6px; font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); }

@media (max-width: 820px) {
  .wlr-hero { grid-template-columns: 1fr; padding-top: 32px; }
  .wlr-hero-side { order: -1; justify-self: start; align-items: flex-start; width: min(78%, 280px); }
}
@media (max-width: 480px) { .wlr-actions .wlr-btn-primary, .wlr-actions .wlr-btn-ghost { width: 100%; } }

/* ---------- Plates (covers, avatars, row icons) ---------- */
.wlr-plate { position: relative; display: block; flex: none; }
.wlr-halo {
  position: absolute; inset: -8%; z-index: 0; border-radius: 32%;
  filter: blur(22px) saturate(1.6); opacity: .42; transform: scale(.94);
  transition: opacity .45s var(--ease), transform .45s var(--ease); pointer-events: none;
}
.wlr-halo img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }
.wlr-halo.is-glow { background: radial-gradient(closest-side, rgba(14, 165, 233, .65), transparent); }
.wlr-halo.is-mono { background: radial-gradient(closest-side, hsl(var(--h) 85% 55% / .6), transparent); }
.wlr-plate-face {
  position: relative; z-index: 1; width: 100%; height: 100%;
  border-radius: 22px; overflow: hidden; display: grid; place-items: center;
  background: linear-gradient(160deg, #ffffff, #eef4fb);
  box-shadow: inset 0 0 0 1px rgba(11, 18, 32, .09), 0 16px 28px -14px rgba(11, 18, 32, .35);
  transition: transform .45s var(--ease), box-shadow .45s var(--ease);
}
.wlr-plate-face::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(140deg, rgba(255, 255, 255, .55), transparent 42%); }
.wlr-plate-face img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wlr-plate-face.is-mono { background: linear-gradient(150deg, hsl(var(--h) 80% 55%), hsl(calc(var(--h) + 38) 75% 36%)); }
.wlr-plate-face.is-mono span {
  position: relative; z-index: 1;
  font-family: var(--font-display); font-weight: 200; font-size: 3.4rem; letter-spacing: -.04em; line-height: 1;
  color: rgba(255, 255, 255, .97); text-shadow: 0 0 18px rgba(255, 255, 255, .5);
}

/* ---------- Tools: shelves + search ---------- */
.wlr-tools { display: flex; flex-direction: column; gap: 14px; margin: -6px 0 clamp(34px, 5vw, 48px); }
.wlr-shelves { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.wlr-shelf {
  display: flex; align-items: center; gap: 12px; min-width: 0; text-align: left;
  padding: 10px 14px 10px 10px; border-radius: 18px; color: var(--text-muted);
  background: rgba(255, 255, 255, .7); box-shadow: inset 0 0 0 1px var(--line-2);
  transition: color .2s, box-shadow .25s, background .25s, transform .25s var(--ease);
}
.wlr-shelf-icon {
  flex: none; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 12px;
  background: linear-gradient(160deg, #ffffff, #eef4fb); box-shadow: inset 0 0 0 1px var(--line-2);
  transition: color .25s, box-shadow .25s;
}
.wlr-shelf-text { display: flex; flex-direction: column; min-width: 0; }
.wlr-shelf-name { font-size: 13.5px; font-weight: 500; line-height: 1.25; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wlr-shelf-count { font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); }
.wlr-shelf:hover { color: var(--wl-sky); background: rgba(14, 165, 233, .05); box-shadow: inset 0 0 0 1px rgba(14, 165, 233, .5); }
.wlr-shelf:hover .wlr-shelf-icon { color: var(--wl-sky); }
.wlr-shelf[aria-pressed="true"] { color: var(--wl-sky); background: rgba(14, 165, 233, .09); box-shadow: inset 0 0 0 1px rgba(14, 165, 233, .6), 0 0 22px rgba(14, 165, 233, .14); }
.wlr-shelf[aria-pressed="true"] .wlr-shelf-icon { color: var(--wl-sky); box-shadow: inset 0 0 0 1px rgba(14, 165, 233, .45), 0 10px 24px -10px rgba(14, 165, 233, .55); }
.wlr-shelf[aria-pressed="true"] .wlr-shelf-count { color: var(--wl-sky); }

.wlr-search {
  display: flex; align-items: center; gap: 8px; align-self: flex-start; width: min(100%, 320px);
  padding: 8px 16px; border-radius: 999px; color: var(--text-dim);
  background: rgba(255, 255, 255, .7); box-shadow: inset 0 0 0 1px var(--line-2);
  transition: box-shadow .2s, background .2s, color .2s;
}
.wlr-search:focus-within { color: var(--wl-sky); background: #fff; box-shadow: inset 0 0 0 1px rgba(14, 165, 233, .6), 0 0 22px rgba(14, 165, 233, .14); }
.wlr-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 13px; color: var(--text-main); }
.wlr-search input::placeholder { color: var(--text-dim); }
.wlr-search input:focus-visible { outline: none; }

/* ---------- Library: every type has its own layout ---------- */
.wlr-groups { display: flex; flex-direction: column; gap: clamp(44px, 7vw, 72px); min-height: 120px; }

.wlr-group-head {
  position: relative; display: flex; align-items: center; gap: 14px;
  padding-bottom: 16px; margin-bottom: 24px; border-bottom: 1px solid var(--line);
}
.wlr-group-head::after { content: ""; position: absolute; left: 0; bottom: -1px; width: 30px; height: 2px; background: var(--wl-sky); box-shadow: 0 0 14px 2px rgba(14, 165, 233, .4); }
.wlr-group-icon {
  flex: none; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 13px; color: var(--wl-sky);
  background: linear-gradient(160deg, #ffffff, #eef4fb); box-shadow: inset 0 0 0 1px rgba(14, 165, 233, .35), 0 10px 24px -12px rgba(14, 165, 233, .5);
}
.wlr-group-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wlr-group-title { font-family: var(--font-display); font-weight: 300; font-size: clamp(1.3rem, 2.8vw, 1.75rem); letter-spacing: -.035em; line-height: 1.15; }
.wlr-group-blurb { font-size: 13px; color: var(--text-dim); }
.wlr-group-count { margin-left: auto; align-self: flex-end; font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); }
.wlr-more { margin-top: 24px; }

/* shared card parts */
.wlr-card {
  position: relative; isolation: isolate; min-width: 0;
  display: flex; transition: transform .4s var(--ease), box-shadow .4s var(--ease);
}
.wlr-card:active { transform: scale(.985); }
.wlr-body { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.wlr-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); }
.wlr-title { margin-top: 14px; font-family: var(--font-display); color: var(--text-main); letter-spacing: -.03em; line-height: 1.14; text-wrap: balance; overflow-wrap: anywhere; }
.wlr-sub {
  margin-top: 10px; font-size: 13.5px; line-height: 1.6; color: var(--text-dim); text-wrap: pretty;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; transition: color .25s;
}
.wlr-foot { margin-top: auto; padding-top: 20px; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; font-weight: 500; color: var(--text-dim); }
.wlr-topics { display: flex; flex-wrap: wrap; gap: 4px 12px; min-width: 0; }
.wlr-go { flex: none; opacity: .5; transform: translateX(-3px); transition: opacity .3s, transform .35s var(--ease), color .3s; }

/* documentary: cover cards */
.wlr-docs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.wlr-doc { flex-direction: column; padding: 14px 14px 22px; border-radius: 26px; }
.wlr-doc::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  background: radial-gradient(260px circle at var(--mx, 30%) var(--my, 20%), rgba(14, 165, 233, .12), transparent 70%), rgba(255, 255, 255, .75);
  box-shadow: inset 0 0 0 1px var(--line-2), 0 18px 34px -22px rgba(14, 165, 233, .5);
  opacity: 0; transition: opacity .35s;
}
.wlr-doc:focus-visible::before { opacity: 1; }
.wlr-doc .wlr-plate { width: 100%; aspect-ratio: 16 / 9; margin-bottom: 22px; }
.wlr-doc .wlr-plate-face { border-radius: 18px; }
.wlr-doc .wlr-plate-face.is-mono span { font-size: clamp(2.6rem, 8vw, 4.2rem); }
.wlr-doc .wlr-body { padding: 0 10px; }
.wlr-doc .wlr-title { font-weight: 200; font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: -.045em; line-height: 1.1; }
.wlr-doc.is-wide { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: clamp(20px, 4vw, 40px); padding: 16px clamp(16px, 3vw, 28px) 16px 16px; }
.wlr-doc.is-wide::before { opacity: 1; background: linear-gradient(180deg, rgba(255, 255, 255, .8), rgba(243, 247, 252, .8)); box-shadow: inset 0 0 0 1px var(--line-2), 0 24px 50px -36px rgba(14, 165, 233, .45); }
.wlr-doc.is-wide .wlr-plate { width: clamp(180px, 36vw, 380px); margin: 0; }
.wlr-doc.is-wide .wlr-body { align-self: stretch; justify-content: center; padding: 8px 0; }
.wlr-doc.is-wide .wlr-foot { margin-top: 0; padding-top: 18px; justify-content: flex-start; gap: 14px; }

/* discovery: ruled text, a sky line draws on hover */
.wlr-finds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 3vw, 36px); }
.wlr-find { flex-direction: column; padding: 22px 4px 8px; }
.wlr-find::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: var(--line-2); }
.wlr-find::after {
  content: ""; position: absolute; top: -1px; left: 0; width: 100%; height: 1px;
  background: var(--wl-sky); box-shadow: 0 0 12px rgba(14, 165, 233, .6);
  transform: scaleX(0); transform-origin: left; transition: transform .6s var(--ease);
}
.wlr-find .wlr-title { font-weight: 300; font-size: 1.28rem; }
.wlr-find:focus-visible::after { transform: scaleX(1); }

/* resource: compact tiles */
.wlr-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 12px; }
.wlr-tile { align-items: center; gap: 14px; padding: 14px 16px; border-radius: 20px; background: rgba(255, 255, 255, .7); box-shadow: inset 0 0 0 1px var(--line-2); }
.wlr-tile::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  background: radial-gradient(220px circle at var(--mx, 30%) var(--my, 20%), rgba(14, 165, 233, .12), transparent 70%);
  opacity: 0; transition: opacity .35s;
}
.wlr-tile-icon {
  flex: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; overflow: hidden; color: var(--text-muted);
  background: linear-gradient(160deg, #ffffff, #eef4fb); box-shadow: inset 0 0 0 1px var(--line-2); transition: color .3s, box-shadow .3s;
}
.wlr-tile-icon img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wlr-tile-title { font-size: 14.5px; font-weight: 500; line-height: 1.3; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.wlr-tile-sub { margin-top: 2px; font-size: 12.5px; line-height: 1.45; color: var(--text-dim); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.wlr-tile-meta { margin-top: 6px; font-family: var(--font-mono); font-size: 10.5px; color: var(--text-dim); }

@media (hover: hover) {
  .wlr-card:hover .wlr-halo { opacity: .8; transform: scale(1.04); }
  .wlr-card:hover .wlr-plate-face { transform: scale(1.02); }
  .wlr-card:hover .wlr-sub { color: var(--text-muted); }
  .wlr-card:hover .wlr-go { opacity: 1; transform: none; color: var(--wl-sky); }
  .wlr-doc:hover { transform: translateY(-3px); }
  .wlr-doc:hover::before { opacity: 1; }
  .wlr-find:hover::after { transform: scaleX(1); }
  .wlr-tile:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1px rgba(14, 165, 233, .45), 0 18px 34px -24px rgba(14, 165, 233, .55); }
  .wlr-tile:hover::before { opacity: 1; }
  .wlr-tile:hover .wlr-tile-icon { color: var(--wl-sky); box-shadow: inset 0 0 0 1px rgba(14, 165, 233, .45), 0 10px 24px -10px rgba(14, 165, 233, .55); }
}
.wlr-tile:focus-visible { box-shadow: inset 0 0 0 1px rgba(14, 165, 233, .6); }

@media (max-width: 900px) {
  .wlr-finds { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wlr-finds .wlr-find:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .wlr-docs, .wlr-finds { grid-template-columns: 1fr; }
  .wlr-doc.is-wide { flex-direction: column; align-items: stretch; padding: 14px 14px 22px; }
  .wlr-doc.is-wide .wlr-plate { width: 100%; margin-bottom: 8px; }
  .wlr-doc.is-wide .wlr-body { padding: 0 10px; }
  .wlr-shelves { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wlr-search { width: 100%; }
}

/* skeletons */
.wlr-sk-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.wlr-sk-card { padding: 14px 4px 8px; pointer-events: none; }
.wlr-sk { display: block; height: 10px; border-radius: 5px; background: rgba(11, 18, 32, .06); animation: wlrPulse 1.6s ease-in-out infinite; margin-top: 12px; }
.wlr-sk.is-plate { height: 150px; border-radius: 18px; margin-top: 0; }
.wlr-sk.w1 { width: 28%; } .wlr-sk.w2 { width: 82%; height: 14px; } .wlr-sk.w3 { width: 60%; }
@keyframes wlrPulse { 50% { opacity: .45; } }
@media (max-width: 640px) { .wlr-sk-grid { grid-template-columns: 1fr; } }

/* empty / error */
.wlr-state { padding: 40px 0; max-width: 46ch; }
.wlr-state h4 { font-family: var(--font-display); font-weight: 300; font-size: 1.4rem; letter-spacing: -.03em; line-height: 1.2; }
.wlr-state p { margin-top: 8px; font-size: 13.5px; line-height: 1.65; color: var(--text-dim); }
.wlr-state .wlr-btn-ghost { margin-top: 20px; }
.wlr-state.is-error h4 { color: var(--status-red); }

/* ---------- Ruled rows on a spine: archive + explore ---------- */
.wlr-rows { position: relative; display: grid; padding-left: 22px; }
.wlr-rows::before {
  content: ""; position: absolute; left: 3px; top: 8px; bottom: 8px; width: 1px; pointer-events: none;
  background: linear-gradient(180deg, transparent, var(--line-2) 12%, var(--line) 88%, transparent);
}
.wlr-row {
  position: relative;
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 18px; align-items: center;
  padding: 20px 4px; border-top: 1px solid var(--line);
  transition: background .25s, padding .3s var(--ease);
}
.wlr-row:first-child { border-top: 0; padding-top: 6px; }
.wlr-row:hover { background: linear-gradient(90deg, rgba(14, 165, 233, .06), transparent 80%); padding-left: 12px; }
.wlr-row-node {
  position: absolute; left: -22px; top: 50%; width: 7px; height: 7px; margin-top: -3.5px; border-radius: 50%;
  background: var(--bg-base); box-shadow: inset 0 0 0 1.5px var(--line-2); transition: background .2s, box-shadow .2s;
}
.wlr-row:hover .wlr-row-node { background: var(--wl-sky); box-shadow: 0 0 0 3px rgba(14, 165, 233, .14), 0 0 12px rgba(14, 165, 233, .6); }
.wlr-row-icon {
  width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; color: var(--text-muted);
  background: linear-gradient(160deg, #ffffff, #eef4fb); box-shadow: inset 0 0 0 1px var(--line-2);
  transition: color .3s, box-shadow .3s;
}
.wlr-row:hover .wlr-row-icon { color: var(--wl-sky); box-shadow: inset 0 0 0 1px rgba(14, 165, 233, .45), 0 10px 24px -10px rgba(14, 165, 233, .55); }
.wlr-row-icon.is-mono { background: linear-gradient(150deg, hsl(var(--h) 80% 55%), hsl(calc(var(--h) + 38) 75% 36%)); color: rgba(255, 255, 255, .97); box-shadow: none; overflow: hidden; }
.wlr-row-icon.is-mono span { font-family: var(--font-display); font-weight: 200; font-size: 1.05rem; letter-spacing: -.03em; }
.wlr-row-icon img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wlr-row-body { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.wlr-row-title { font-size: 16px; font-weight: 500; line-height: 1.3; overflow-wrap: anywhere; }
.wlr-row-sub {
  font-size: 13px; color: var(--text-dim); line-height: 1.5; transition: color .25s;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.wlr-row:hover .wlr-row-sub { color: var(--text-muted); }
.wlr-row-end { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.wlr-row-date { font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); white-space: nowrap; }

@media (max-width: 480px) {
  .wlr-row { grid-template-columns: 40px minmax(0, 1fr); gap: 14px; }
  .wlr-row-icon { width: 40px; height: 40px; border-radius: 12px; }
  .wlr-row-end { display: none; }
}

/* ---------- Client portal CTA ---------- */
.wlr-portal {
  position: relative; isolation: isolate; overflow: hidden;
  padding: clamp(28px, 5vw, 56px); border-radius: 28px;
  background:
    radial-gradient(70% 140% at 12% 0%, rgba(14, 165, 233, .16), transparent 70%),
    linear-gradient(180deg, rgba(255, 255, 255, .9), rgba(243, 247, 252, .9));
  box-shadow: inset 0 0 0 1px var(--line-2), 0 30px 60px -36px rgba(14, 165, 233, .55);
}
.wlr-portal::before {
  content: ""; position: absolute; top: -1px; left: 36px; width: 34px; height: 2px;
  background: var(--wl-sky); box-shadow: 0 0 14px 2px rgba(14, 165, 233, .45);
}
.wlr-portal h2 {
  margin-top: 14px; max-width: 20ch; text-wrap: balance;
  font-family: var(--font-display); font-weight: 200;
  font-size: clamp(1.8rem, 5vw, 3rem); letter-spacing: -.045em; line-height: 1.08;
}
.wlr-portal p { margin-top: 16px; max-width: 52ch; font-size: 14px; line-height: 1.7; color: var(--text-muted); }
.wlr-portal .wlr-actions { margin-top: 28px; }

/* ==========================================================================
   Reader
   ========================================================================== */
.wlr-article { display: flex; flex-direction: column; padding-top: clamp(28px, 5vw, 56px); animation: wlrFade .6s var(--ease) both; }
.wlr-back { align-self: flex-start; margin-bottom: clamp(22px, 4vw, 40px); }

.wlr-ah { outline: none; max-width: 860px; }
.wlr-ameta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); }
.wlr-atitle {
  margin-top: 20px; max-width: 20ch; text-wrap: balance; overflow-wrap: anywhere;
  font-family: var(--font-display); font-weight: 200;
  font-size: clamp(2.2rem, 6.4vw, 3.9rem); line-height: 1.05; letter-spacing: -.05em;
}
.wlr-asub { margin-top: clamp(16px, 2.6vw, 24px); max-width: 56ch; font-size: clamp(15px, 1.9vw, 18px); line-height: 1.65; color: var(--text-muted); text-wrap: pretty; }

.wlr-author {
  display: flex; align-items: center; gap: 14px;
  margin-top: clamp(24px, 4vw, 36px); padding-top: 20px; border-top: 1px solid var(--line);
}
.wlr-avatar {
  flex: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px;
  font-family: var(--font-mono); font-size: 12px; font-weight: 600; color: var(--wl-sky);
  background: linear-gradient(160deg, #ffffff, #eef4fb); box-shadow: inset 0 0 0 1px rgba(14, 165, 233, .35), 0 10px 24px -12px rgba(14, 165, 233, .5);
}
.wlr-author-info { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.wlr-author-name { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wlr-author-role { font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wlr-copy-link { flex: none; }

.wlr-cover { position: relative; margin-top: clamp(28px, 5vw, 48px); width: 100%; aspect-ratio: 21 / 9; }
.wlr-cover .wlr-halo { inset: -4%; filter: blur(34px) saturate(1.6); opacity: .5; }
.wlr-cover .wlr-plate-face { border-radius: 28px; box-shadow: inset 0 0 0 1px rgba(11, 18, 32, .09), 0 30px 60px -30px rgba(14, 165, 233, .5), 0 8px 18px -10px rgba(11, 18, 32, .25); }

.wlr-abody {
  display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: clamp(32px, 6vw, 72px);
  margin-top: clamp(36px, 6vw, 64px);
}
.wlr-toc { position: sticky; top: calc(88px + var(--safe-top)); align-self: start; }
.wlr-toc-title { font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 14px; }
.wlr-toc-list { position: relative; list-style: none; display: grid; gap: 2px; padding-left: 18px; }
.wlr-toc-list::before { content: ""; position: absolute; left: 3px; top: 6px; bottom: 6px; width: 1px; background: linear-gradient(180deg, transparent, var(--line-2) 12%, var(--line) 88%, transparent); }
.wlr-toc-link {
  position: relative; display: block; padding: 7px 0; font-size: 12.5px; line-height: 1.4; color: var(--text-dim);
  transition: color .2s;
}
.wlr-toc-link::before {
  content: ""; position: absolute; left: -18px; top: 13px; width: 7px; height: 7px; border-radius: 50%;
  background: var(--bg-base); box-shadow: inset 0 0 0 1.5px var(--line-2); transition: background .2s, box-shadow .2s;
}
.wlr-toc-link:hover { color: var(--text-main); }
.wlr-toc-link.is-active { color: var(--text-main); font-weight: 500; }
.wlr-toc-link.is-active::before { background: var(--wl-sky); box-shadow: 0 0 0 3px rgba(14, 165, 233, .14), 0 0 12px rgba(14, 165, 233, .6); }

.wlr-prose { display: flex; flex-direction: column; gap: 24px; max-width: 66ch; min-width: 0; }
.wlr-p { font-size: 16.5px; line-height: 1.8; color: #1e293b; text-wrap: pretty; overflow-wrap: anywhere; }
.wlr-p.is-lede { font-size: clamp(17.5px, 2.2vw, 19.5px); line-height: 1.7; color: var(--text-main); }
.wlr-prose a { color: var(--wl-blue); text-decoration: underline; text-decoration-color: rgba(14, 165, 233, .45); text-underline-offset: 3px; transition: text-decoration-color .2s, color .2s; }
.wlr-prose a:hover { color: var(--wl-sky); text-decoration-color: var(--wl-sky); }

.wlr-h {
  position: relative; scroll-margin-top: calc(88px + var(--safe-top));
  margin-top: 22px; padding-top: 22px;
  font-family: var(--font-display); font-weight: 300; font-size: clamp(1.4rem, 3vw, 1.85rem); letter-spacing: -.035em; line-height: 1.2;
  text-wrap: balance;
}
.wlr-h::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: linear-gradient(90deg, var(--line-2), var(--line) 55%, transparent); }
.wlr-h::after { content: ""; position: absolute; top: -1px; left: 0; width: 30px; height: 2px; background: var(--wl-sky); box-shadow: 0 0 14px 2px rgba(14, 165, 233, .4); }
.wlr-prose > .wlr-h:first-child { margin-top: 0; }

.wlr-quote {
  position: relative; margin: 10px 0; padding: 4px 0 4px 26px;
  font-family: var(--font-display); font-weight: 200; font-size: clamp(1.35rem, 3vw, 1.85rem); letter-spacing: -.035em; line-height: 1.3;
  text-wrap: balance; color: var(--text-main);
}
.wlr-quote::before { content: ""; position: absolute; left: 0; top: 4px; bottom: 4px; width: 2px; border-radius: 2px; background: var(--wl-sky); box-shadow: 0 0 14px 2px rgba(14, 165, 233, .4); }

.wlr-code {
  border-radius: 16px; overflow: hidden; background: var(--bg-tint);
  box-shadow: inset 0 0 0 1px var(--line-2), 0 18px 34px -26px rgba(14, 165, 233, .45);
}
.wlr-code-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px 8px 16px;
  border-bottom: 1px solid var(--line); font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--text-dim);
}
.wlr-copy-code {
  padding: 5px 12px; border-radius: 999px; font-family: var(--font-ui); font-size: 11.5px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--text-muted);
  box-shadow: inset 0 0 0 1px var(--line-2); background: rgba(255, 255, 255, .7); transition: color .2s, box-shadow .2s, background .2s;
}
.wlr-copy-code:hover { color: var(--wl-sky); background: rgba(14, 165, 233, .05); box-shadow: inset 0 0 0 1px rgba(14, 165, 233, .5); }
.wlr-code pre { overflow-x: auto; padding: 16px 18px; font-family: var(--font-mono); font-size: 12.5px; line-height: 1.7; color: var(--text-main); tab-size: 2; }
.wlr-code code { font-family: inherit; }

.wlr-fig { position: relative; margin: 10px 0; }
.wlr-fig .wlr-halo { inset: -3%; filter: blur(30px) saturate(1.6); opacity: .4; }
.wlr-fig .wlr-plate-face { height: auto; border-radius: 22px; display: block; }
.wlr-fig .wlr-plate-face img { height: auto; }
.wlr-fig figcaption { position: relative; z-index: 1; margin-top: 12px; font-size: 12.5px; line-height: 1.5; color: var(--text-dim); }

/* pager */
.wlr-pager { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(20px, 4vw, 44px); margin-top: clamp(48px, 8vw, 88px); }
.wlr-pg { position: relative; display: block; padding-top: 22px; min-width: 0; }
.wlr-pg::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: var(--line-2); }
.wlr-pg::after {
  content: ""; position: absolute; top: -1px; left: 0; width: 100%; height: 1px;
  background: var(--wl-sky); box-shadow: 0 0 12px rgba(14, 165, 233, .6);
  transform: scaleX(0); transform-origin: left; transition: transform .6s var(--ease);
}
.wlr-pg:hover::after, .wlr-pg:focus-visible::after { transform: scaleX(1); }
.wlr-pg-label { display: block; font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--text-muted); }
.wlr-pg-title { display: block; margin-top: 12px; font-family: var(--font-display); font-weight: 300; font-size: 1.3rem; letter-spacing: -.03em; line-height: 1.2; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.wlr-pg-date { display: block; margin-top: 8px; font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); }
.wlr-pg.is-older { grid-column: 2; }
.wlr-pg.is-newer + .wlr-pg.is-older { grid-column: 2; }

/* reader loading */
.wlr-rsk { padding-top: 12px; max-width: 760px; }
.wlr-rsk .wlr-sk { margin-top: 16px; }
.wlr-rsk .wlr-sk.t { height: 38px; width: 78%; border-radius: 8px; margin-top: 22px; }

@media (max-width: 1000px) {
  .wlr-abody { grid-template-columns: minmax(0, 1fr); }
  .wlr-toc { display: none; }
}
@media (max-width: 640px) {
  .wlr-pager { grid-template-columns: 1fr; }
  .wlr-pg.is-older, .wlr-pg.is-newer + .wlr-pg.is-older { grid-column: auto; }
  .wlr-author { flex-wrap: wrap; }
  .wlr-copy-link { margin-left: 58px; }
  .wlr-p { font-size: 16px; }
}

/* ---------- Footer ---------- */
.wlr-footer {
  position: relative; z-index: 2; flex-shrink: 0;
  padding: 32px 24px calc(32px + env(safe-area-inset-bottom, 0px));
  text-align: center;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-dim);
  border-top: 1px solid var(--line);
}
.wlr-footer::before {
  content: ""; position: absolute; top: -1px; left: 50%; transform: translateX(-50%); width: 120px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(14, 165, 233, .6), transparent);
  box-shadow: 0 0 24px 3px rgba(14, 165, 233, .18);
}

/* ---------- Motion ---------- */
.wlr [data-motion] { animation: wlrFade .8s var(--ease) both; animation-delay: var(--d, 0s); }
@keyframes wlrFade { from { opacity: 0; transform: translateY(10px); } }

/* scroll reveal: armed only once JS has mounted, so the static fallback is never hidden */
.wlr.is-armed .wlr-reveal { transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: var(--d, 0s); }
.wlr.is-armed .wlr-reveal:not(.is-in) { opacity: 0; transform: translateY(16px); }

/* ---------- Small screens ---------- */
@media (max-width: 480px) {
  .wlr-wrap { padding: 0 16px 40px; }
  .wlr-bar { margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
  .wlr-brand-name { font-size: 1rem; }
  .wlr-brand-section { display: none; }
  .wlr-portal::before { left: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .wlr *, .wlr *::before, .wlr *::after { animation: none !important; transition-duration: .01ms !important; }
  .wlr.is-armed .wlr-reveal:not(.is-in) { opacity: 1; transform: none; }
}

/* ==========================================================================
   Research reader additions
   ========================================================================== */
.wlr-toc-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.wlr-toc-head .wlr-toc-title { margin-bottom: 0; }
.wlr-toc-count { font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); }
.wlr-toc-list li.is-sub { padding-left: 12px; }
.wlr-toc-list li.is-sub .wlr-toc-link { font-size: 12px; }
.wlr-toc-list li.is-sub .wlr-toc-link::before { width: 5px; height: 5px; left: -16px; top: 14px; }

.wlr-chip-status {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-mono); font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted);
}
.wlr-chip-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--text-dim); }
.wlr-chip-status.is-published::before { background: var(--status-green); box-shadow: 0 0 0 3px rgba(5, 150, 105, .14), 0 0 10px rgba(5, 150, 105, .55); }
.wlr-chip-status.is-draft::before, .wlr-chip-status.is-review::before { background: var(--status-yellow); box-shadow: 0 0 0 3px rgba(217, 119, 6, .12), 0 0 10px rgba(217, 119, 6, .45); }
.wlr-chip-ver { font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; color: var(--text-muted); padding: 3px 8px; border-radius: 4px; box-shadow: inset 0 0 0 1px var(--line-2); }

.wlr-abstract {
  position: relative; margin-top: clamp(20px, 3.4vw, 30px); max-width: 64ch; padding: 22px 24px; border-radius: 22px;
  background:
    radial-gradient(70% 140% at 12% 0%, rgba(14, 165, 233, .12), transparent 70%),
    linear-gradient(180deg, rgba(255, 255, 255, .9), rgba(243, 247, 252, .9));
  box-shadow: inset 0 0 0 1px var(--line-2), 0 24px 50px -38px rgba(14, 165, 233, .55);
}
.wlr-abstract::before { content: ""; position: absolute; top: -1px; left: 24px; width: 34px; height: 2px; background: var(--wl-sky); box-shadow: 0 0 14px 2px rgba(14, 165, 233, .45); }
.wlr-abstract p { margin-top: 10px; font-size: 15px; line-height: 1.75; color: var(--text-muted); text-wrap: pretty; overflow-wrap: anywhere; }
.wlr-abstract a { color: var(--wl-blue); text-decoration: underline; text-decoration-color: rgba(14, 165, 233, .45); text-underline-offset: 3px; }

.wlr-facts { display: flex; flex-wrap: wrap; gap: 14px clamp(24px, 5vw, 48px); margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.wlr-fact { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.wlr-fact dt { font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--text-dim); }
.wlr-fact dd { font-family: var(--font-display); font-weight: 300; font-size: 1.1rem; letter-spacing: -.02em; color: var(--text-main); font-variant-numeric: tabular-nums; }
.wlr-fact dd.is-topics { font-family: var(--font-ui); font-weight: 400; font-size: 13.5px; letter-spacing: 0; color: var(--text-muted); max-width: 32ch; }

.wlr-col { display: flex; flex-direction: column; gap: clamp(44px, 7vw, 72px); min-width: 0; max-width: 760px; }
.wlr-col .wlr-prose { max-width: 66ch; }
.wlr-panel .wlr-sec-head { margin-bottom: 20px; }

.wlr-h.is-h3 { margin-top: 8px; padding-top: 0; font-weight: 400; font-size: clamp(1.1rem, 2.2vw, 1.3rem); letter-spacing: -.02em; }
.wlr-h.is-h3::before, .wlr-h.is-h3::after { display: none; }
.wlr-h { transition: color .4s var(--ease); }
.wlr-h.is-flash { color: var(--wl-sky); }

.wlr-quote cite { display: block; margin-top: 14px; font-family: var(--font-ui); font-style: normal; font-size: 13px; letter-spacing: 0; color: var(--text-dim); }
.wlr-quote cite::before { content: "\2014\00a0"; }

.wlr-list { display: block; padding-left: 22px; font-size: 16.5px; line-height: 1.75; color: #1e293b; }
ul.wlr-list { list-style: disc; }
ol.wlr-list { list-style: decimal; }
.wlr-list li { padding-left: 4px; overflow-wrap: anywhere; }
.wlr-list li + li { margin-top: 8px; }
.wlr-list li::marker { color: var(--wl-sky); font-weight: 600; }

.wlr-callout {
  position: relative; padding: 18px 22px 18px 26px; border-radius: 18px;
  background: rgba(14, 165, 233, .06); box-shadow: inset 0 0 0 1px rgba(14, 165, 233, .22);
  --tone: var(--wl-sky);
}
.wlr-callout::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 2px; border-radius: 2px; background: var(--tone); box-shadow: 0 0 14px 2px color-mix(in srgb, var(--tone) 45%, transparent); }
.wlr-callout.is-warning { --tone: var(--status-yellow); background: rgba(217, 119, 6, .07); box-shadow: inset 0 0 0 1px rgba(217, 119, 6, .25); }
.wlr-callout.is-tip { --tone: var(--status-green); background: rgba(5, 150, 105, .07); box-shadow: inset 0 0 0 1px rgba(5, 150, 105, .25); }
.wlr-callout-label { display: block; margin-bottom: 8px; font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--tone); }
.wlr-callout-body { font-size: 15px; line-height: 1.7; color: #1e293b; overflow-wrap: anywhere; }
.wlr-callout-body a { color: var(--wl-blue); text-decoration: underline; text-underline-offset: 3px; }

.wlr-table-wrap { overflow-x: auto; border-radius: 16px; box-shadow: inset 0 0 0 1px var(--line-2); background: rgba(255, 255, 255, .7); }
.wlr-table { width: 100%; border-collapse: collapse; font-size: 13.5px; line-height: 1.5; }
.wlr-table th {
  padding: 12px 16px; text-align: left; white-space: nowrap; background: var(--bg-tint);
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--text-muted);
}
.wlr-table td { padding: 12px 16px; vertical-align: top; color: #1e293b; border-top: 1px solid var(--line); min-width: 120px; overflow-wrap: anywhere; }
.wlr-table tbody tr:first-child td { border-top: 0; }
.wlr-table thead + tbody tr:first-child td { border-top: 1px solid var(--line); }

.wlr-video { position: relative; aspect-ratio: 16 / 9; border-radius: 22px; overflow: hidden; background: var(--bg-tint); box-shadow: inset 0 0 0 1px var(--line-2), 0 24px 50px -34px rgba(14, 165, 233, .5); }
.wlr-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }

.wlr-res-inline {
  display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: 18px;
  background: rgba(255, 255, 255, .7); box-shadow: inset 0 0 0 1px var(--line-2); text-decoration: none;
  transition: box-shadow .25s, background .25s, transform .25s var(--ease);
}
.wlr-prose a.wlr-res-inline { color: var(--text-main); text-decoration: none; }
.wlr-res-icon { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 13px; color: var(--text-muted); background: linear-gradient(160deg, #ffffff, #eef4fb); box-shadow: inset 0 0 0 1px var(--line-2); transition: color .25s, box-shadow .25s; }
.wlr-res-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wlr-res-label { font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.wlr-res-kind { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-dim); }
a.wlr-res-inline:hover { background: rgba(14, 165, 233, .05); box-shadow: inset 0 0 0 1px rgba(14, 165, 233, .5), 0 0 22px rgba(14, 165, 233, .12); }
a.wlr-res-inline:hover .wlr-res-icon { color: var(--wl-sky); box-shadow: inset 0 0 0 1px rgba(14, 165, 233, .45); }

.wlr-res-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 12px; }
.wlr-resc {
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; padding: 16px; border-radius: 20px;
  background: rgba(255, 255, 255, .7); box-shadow: inset 0 0 0 1px var(--line-2);
  transition: box-shadow .25s, background .25s, transform .3s var(--ease);
}
a.wlr-resc:hover { transform: translateY(-2px); background: rgba(14, 165, 233, .04); box-shadow: inset 0 0 0 1px rgba(14, 165, 233, .5), 0 18px 34px -24px rgba(14, 165, 233, .55); }
.wlr-resc-label { font-size: 14.5px; font-weight: 500; line-height: 1.3; overflow-wrap: anywhere; }
.wlr-resc-url { max-width: 100%; font-family: var(--font-mono); font-size: 10.5px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.wlr-refs { list-style: none; counter-reset: ref; display: grid; }
.wlr-ref {
  counter-increment: ref; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px;
  padding: 13px 0; border-top: 1px solid var(--line); font-size: 13.5px; line-height: 1.6; color: var(--text-muted); overflow-wrap: anywhere;
}
.wlr-ref:first-child { border-top: 0; padding-top: 0; }
.wlr-ref::before { content: counter(ref); font-family: var(--font-mono); font-size: 11px; line-height: 1.9; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.wlr-ref a { color: var(--wl-blue); text-decoration: underline; text-decoration-color: rgba(14, 165, 233, .45); text-underline-offset: 3px; transition: color .2s, text-decoration-color .2s; }
.wlr-ref a:hover { color: var(--wl-sky); text-decoration-color: var(--wl-sky); }

.wlr-review { position: relative; display: flex; flex-wrap: wrap; gap: 20px clamp(32px, 6vw, 64px); padding-top: 24px; border-top: 1px solid var(--line-2); }
.wlr-review::before { content: ""; position: absolute; top: -1px; left: 0; width: 30px; height: 2px; background: var(--wl-sky); box-shadow: 0 0 14px 2px rgba(14, 165, 233, .4); }
.wlr-review-block { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.wlr-review-value { margin-top: 4px; font-size: 14.5px; font-weight: 500; }
.wlr-review-meta { font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); }
