/* ---------- Sigrix Learn — hub page ----------
 * Lifted from Sigrix_new/Sigrix Learn.html. The lrn-* classes drive the
 * library landing page (hero, featured cornerstone, article grid and the
 * newsletter strip). Light is the base cascade; dark is layered on via
 * [data-theme="dark"] .sx, matching the rest of the app. Category accent
 * tokens come from sx-learn-article.css. */

/* ─────────────────── Hero ───────────────────
 * `.lrn-hero` and `.lrn-rail` get their full-viewport breakout from the
 * shared `.sx-bleed` rule in sx-home.css (#3080). */
.lrn-hero { position: relative; padding: 80px 0 36px; overflow: hidden; }
.lrn-hero-bg {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(900px 380px at 12% 0%, rgba(26,31,107,0.10), transparent 60%),
    radial-gradient(700px 360px at 92% 10%, rgba(20,184,166,0.08), transparent 60%);
  mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
}
[data-theme="dark"] .sx .lrn-hero-bg {
  background:
    radial-gradient(900px 380px at 12% 0%, rgba(61,77,255,0.20), transparent 60%),
    radial-gradient(700px 360px at 92% 10%, rgba(124,227,212,0.10), transparent 60%);
}
.lrn-hero-grid {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(14,19,32,0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(14,19,32,0.04) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(700px 360px at 50% 0%, black, transparent 70%);
}
[data-theme="dark"] .sx .lrn-hero-grid {
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.04) 1px, transparent 1px);
}
.lrn-hero-inner { position: relative; }
.lrn-hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--sx-font-mono); font-size: 11px;
  color: var(--sx-text-3); letter-spacing: 0.10em; text-transform: uppercase;
  padding: 6px 10px; border-radius: 999px;
  background: var(--sx-surface); box-shadow: 0 0 0 1px var(--sx-line) inset;
}
.lrn-hero-eyebrow .pulse {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--sx-ok);
  box-shadow: 0 0 0 3px rgba(110,231,161,0.18);
}
.lrn-hero h1 {
  margin-top: 22px;
  font-size: 84px; font-weight: 600; letter-spacing: -0.04em; line-height: 0.96;
}
.lrn-hero h1 .accent {
  color: transparent; -webkit-text-stroke: 1px var(--sx-line-2);
  font-style: italic;
}
.lrn-hero .lede {
  margin-top: 20px; font-size: 19px; color: var(--sx-text-2); max-width: 56ch; line-height: 1.55;
}
.lrn-hero-actions {
  margin-top: 32px; display: grid; grid-template-columns: 1fr auto; gap: 16px; max-width: 720px;
}
.lrn-hero-search {
  display: flex; align-items: center; gap: 10px;
  height: 48px; padding: 0 16px;
  background: var(--sx-surface);
  border-radius: var(--sx-r-md);
  box-shadow: 0 0 0 1px var(--sx-line) inset;
  transition: box-shadow 120ms;
}
.lrn-hero-search:focus-within { box-shadow: 0 0 0 1px var(--sx-brand-3) inset, 0 0 0 4px rgba(107,120,255,0.10); }
.lrn-hero-search input {
  flex: 1; background: none; border: 0; outline: none;
  font-family: inherit; font-size: 15px; color: var(--sx-text);
}
.lrn-hero-search input::placeholder { color: var(--sx-text-3); }
.lrn-hero-search .icon { color: var(--sx-text-3); display: inline-flex; }
.lrn-hero-search .kbd {
  font-family: var(--sx-font-mono); font-size: 11px;
  padding: 3px 8px; border-radius: 4px;
  background: var(--sx-bg); color: var(--sx-text-3);
  box-shadow: 0 0 0 1px var(--sx-line) inset;
}
.lrn-hero-meta {
  margin-top: 26px;
  display: flex; gap: 18px; flex-wrap: wrap;
  font-family: var(--sx-font-mono); font-size: 11px; color: var(--sx-text-3);
  letter-spacing: 0.04em;
}
.lrn-hero-meta .sep { width: 4px; height: 4px; border-radius: 50%; background: var(--sx-line-2); align-self: center; }
.lrn-hero-meta b { color: var(--sx-text-2); font-weight: 500; }

/* ─────────────────── Sticky filter rail ───────────────────
 * Ported from Sigrix_new/Sigrix Learn.html. The rail sticks under the
 * site header (60px tall) and offers category pills + a sort dropdown.
 * Full-bleed via the breakout above; inner content stays in the
 * sx-container 1200px grid. */
.lrn-rail {
  position: sticky; top: 60px; z-index: 4;
  background: rgba(250,250,251,0.88);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  border-top: 1px solid var(--sx-line);
  border-bottom: 1px solid var(--sx-line);
}
[data-theme="dark"] .sx .lrn-rail { background: rgba(11,13,18,0.82); }
.lrn-rail-inner {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 0;
  overflow-x: auto; scrollbar-width: none;
}
.lrn-rail-inner::-webkit-scrollbar { display: none; }
.lrn-rail-label {
  font-family: var(--sx-font-mono); font-size: 11px;
  letter-spacing: 0.10em; text-transform: uppercase;
  color: var(--sx-text-3); white-space: nowrap;
  padding-right: 6px; border-right: 1px solid var(--sx-line); margin-right: 2px;
}
.lrn-pills { display: flex; gap: 6px; flex: 1; }
.lrn-pill {
  display: inline-flex; align-items: center; gap: 8px;
  height: 32px; padding: 0 12px; border-radius: 999px;
  font-size: 13px; font-weight: 500; color: var(--sx-text-2);
  background: transparent;
  box-shadow: 0 0 0 1px var(--sx-line) inset;
  transition: color 120ms, background 120ms, box-shadow 120ms;
  white-space: nowrap;
  cursor: pointer;
}
.lrn-pill:hover { color: var(--sx-text); box-shadow: 0 0 0 1px var(--sx-line-2) inset; }
.lrn-pill .dot { width: 8px; height: 8px; border-radius: 2px; background: currentColor; opacity: 0.85; }
.lrn-pill .count {
  font-family: var(--sx-font-mono); font-size: 11px; color: var(--sx-text-3);
  margin-left: 2px; padding: 1px 5px; border-radius: 3px;
  background: var(--sx-surface); box-shadow: 0 0 0 1px var(--sx-line) inset;
}
.lrn-pill[aria-pressed="true"] {
  background: var(--sx-surface); color: var(--sx-text);
  box-shadow: 0 0 0 1px var(--sx-line-2) inset, inset 0 0 0 2px var(--pill-accent, var(--sx-brand-3));
}
.lrn-pill[aria-pressed="true"][data-cat="all"] {
  box-shadow: 0 0 0 1px var(--sx-line-2) inset, inset 0 0 0 2px var(--sx-text);
}
.lrn-rail-sort {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--sx-text-2); white-space: nowrap;
  padding-left: 14px; border-left: 1px solid var(--sx-line);
}
.lrn-rail-sort-label {
  font-family: var(--sx-font-mono); font-size: 11px;
  letter-spacing: 0.10em; text-transform: uppercase;
  color: var(--sx-text-3);
}
.lrn-rail-sort select {
  background: transparent; color: inherit; border: 0; outline: none;
  font-family: inherit; font-size: 13px; cursor: pointer;
  padding: 4px 6px; border-radius: 4px;
}
.lrn-rail-sort select:hover { background: var(--sx-surface); }

/* ─────────────────── Section ─────────────────── */
.lrn-section { padding: 48px 0; }
.lrn-section + .lrn-section { padding-top: 0; }
.lrn-section-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px;
  margin-bottom: 22px;
}
.lrn-section-head h2 { font-size: 28px; font-weight: 600; letter-spacing: -0.025em; }
.lrn-section-head .sub { color: var(--sx-text-2); font-size: 14px; margin-top: 6px; max-width: 60ch; }
.lrn-section-head .more {
  font-size: 13px; color: var(--sx-text-2); display: inline-flex; align-items: center; gap: 6px;
}
.lrn-section-head .more:hover { color: var(--sx-text); }

/* ─────────────────── Featured cornerstone ─────────────────── */
.lrn-featured {
  display: grid; grid-template-columns: 1.05fr 1fr; gap: 0;
  border-radius: var(--sx-r-xl);
  background: var(--sx-surface);
  box-shadow: 0 0 0 1px var(--sx-line) inset;
  overflow: hidden;
  position: relative;
}
.lrn-art {
  position: relative; overflow: hidden;
  background:
    radial-gradient(420px 220px at 25% 20%, color-mix(in oklab, var(--art-accent, var(--sx-brand-3)) 28%, transparent), transparent 60%),
    var(--sx-bg-2);
}
.lrn-art svg { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.5; }
.lrn-featured-art { min-height: 380px; }
.lrn-featured-art::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(135deg, transparent 40%, rgba(14,19,32,0.06) 100%);
  pointer-events: none;
}
[data-theme="dark"] .sx .lrn-featured-art::after {
  background: linear-gradient(135deg, transparent 40%, rgba(11,13,18,0.4) 100%);
}
.lrn-featured-body {
  padding: 40px;
  display: flex; flex-direction: column; justify-content: center;
  gap: 18px;
}
.lrn-featured-pin {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--sx-font-mono); font-size: 10px; letter-spacing: 0.14em;
  color: var(--cat-foundations); font-weight: 600; text-transform: uppercase;
}
.lrn-featured-pin .star {
  width: 14px; height: 14px; display: inline-flex; align-items: center; justify-content: center;
}
.lrn-featured h2 {
  font-size: 38px; font-weight: 600; letter-spacing: -0.025em; line-height: 1.05;
  color: var(--sx-text);
  max-width: 18ch;
}
.lrn-featured p { font-size: 15px; color: var(--sx-text-2); line-height: 1.65; max-width: 52ch; }
.lrn-featured-meta {
  display: flex; align-items: center; gap: 14px;
  font-family: var(--sx-font-mono); font-size: 11px; color: var(--sx-text-3); letter-spacing: 0.04em;
}
.lrn-featured-meta .author {
  display: inline-flex; align-items: center; gap: 8px; color: var(--sx-text-2);
}
.lrn-featured-meta .av {
  width: 22px; height: 22px; border-radius: 50%;
  background: linear-gradient(135deg, #3D4DFF, #1A1F6B);
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 600; font-size: 10px;
  font-family: var(--sx-font-body);
}
.lrn-featured-meta .sep { width: 4px; height: 4px; border-radius: 50%; background: var(--sx-line-2); }
.lrn-featured-actions { display: flex; gap: 10px; margin-top: 6px; flex-wrap: wrap; }

/* ─────────────────── Article grid ─────────────────── */
.lrn-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px;
}
.lrn-card {
  display: flex; flex-direction: column;
  border-radius: var(--sx-r-lg);
  background: var(--sx-surface);
  box-shadow: 0 0 0 1px var(--sx-line) inset;
  overflow: hidden;
  transition: transform 160ms, box-shadow 160ms;
}
.lrn-card:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px var(--sx-line-2) inset, 0 8px 24px -10px rgba(14,19,32,0.12); }
[data-theme="dark"] .sx .lrn-card:hover { box-shadow: 0 0 0 1px var(--sx-line-2) inset, 0 8px 24px -8px rgba(0,0,0,0.4); }
.lrn-card-art { position: relative; height: 180px; }
.lrn-card-body {
  padding: 20px;
  display: flex; flex-direction: column; gap: 10px; flex: 1;
}
.lrn-card-cat {
  display: inline-flex; align-items: center; gap: 6px; align-self: flex-start;
  font-family: var(--sx-font-mono); font-size: 10px; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase;
}
.lrn-card-cat .dot { width: 8px; height: 8px; border-radius: 2px; background: currentColor; }
.lrn-card h3 {
  font-size: 19px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.25;
  color: var(--sx-text);
  text-wrap: balance;
}
.lrn-card .summary {
  font-size: 13px; color: var(--sx-text-2); line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.lrn-card-meta {
  margin-top: auto; padding-top: 12px;
  display: flex; align-items: center; gap: 10px;
  font-family: var(--sx-font-mono); font-size: 11px; color: var(--sx-text-3);
  letter-spacing: 0.04em;
}
.lrn-card-meta .sep { width: 3px; height: 3px; border-radius: 50%; background: var(--sx-line-2); }

.lrn-empty {
  margin-top: 18px;
  padding: 32px;
  text-align: center;
  background: var(--sx-surface);
  border-radius: var(--sx-r-lg);
  box-shadow: 0 0 0 1px var(--sx-line) inset;
  color: var(--sx-text-3);
  font-size: 14px;
}

/* ─────────────────── Newsletter strip ─────────────────── */
.lrn-news {
  position: relative;
  padding: 48px 40px;
  border-radius: var(--sx-r-xl);
  background:
    radial-gradient(600px 220px at 100% 0%, rgba(26,31,107,0.12), transparent 60%),
    var(--sx-surface);
  box-shadow: 0 0 0 1px var(--sx-line) inset;
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 32px; align-items: center;
  overflow: hidden;
}
[data-theme="dark"] .sx .lrn-news {
  background:
    radial-gradient(600px 220px at 100% 0%, rgba(61,77,255,0.20), transparent 60%),
    radial-gradient(400px 200px at 0% 100%, rgba(124,227,212,0.10), transparent 60%),
    var(--sx-surface);
}
.lrn-news h2 { font-size: 28px; font-weight: 600; max-width: 18ch; letter-spacing: -0.025em; }
.lrn-news p { color: var(--sx-text-2); margin-top: 10px; font-size: 14px; max-width: 50ch; line-height: 1.55; }
.lrn-news-form {
  display: grid; grid-template-columns: 1fr auto; gap: 8px;
  background: var(--sx-bg);
  padding: 6px;
  border-radius: var(--sx-r-md);
  box-shadow: 0 0 0 1px var(--sx-line) inset;
}
.lrn-news-form input {
  height: 40px; padding: 0 12px; border: 0; outline: none;
  background: transparent; color: var(--sx-text); font-family: inherit; font-size: 14px;
}
.lrn-news-form input::placeholder { color: var(--sx-text-3); }
.lrn-news-fineprint {
  margin-top: 14px;
  font-family: var(--sx-font-mono); font-size: 11px; color: var(--sx-text-3); letter-spacing: 0.04em;
}

@media (max-width: 980px) {
  .lrn-hero h1 { font-size: 56px; }
  .lrn-featured { grid-template-columns: 1fr; }
  .lrn-featured-art { min-height: 220px; }
  .lrn-grid { grid-template-columns: repeat(2, 1fr); }
  .lrn-news { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .lrn-hero h1 { font-size: 44px; }
  .lrn-grid { grid-template-columns: 1fr; }
  .lrn-hero-actions { grid-template-columns: 1fr; }
}
