/* ---------- RESOURCES PAGE ---------- */

/* Featured ----------------------------------------------------- */
.res-featured {
  position: relative;
  padding: 40px 0 80px;
  background: var(--site-bg);
  border-top: 1px solid var(--site-line);
}
.res-feat-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 48px;
  align-items: stretch;
  border: 1px solid var(--site-line);
  background: linear-gradient(180deg, rgba(10,15,34,0.6), rgba(2,3,10,0.4));
  position: relative;
}
.res-feat-grid::before,
.res-feat-grid::after {
  content: ""; position: absolute; width: 12px; height: 12px;
  border: 1px solid var(--site-cyan);
  pointer-events: none;
}
.res-feat-grid::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.res-feat-grid::after  { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }

/* Featured cover */
.res-feat-cover {
  position: relative;
  min-height: 420px;
  background:
    radial-gradient(60% 60% at 30% 30%, rgba(0,85,255,0.32), transparent 60%),
    radial-gradient(50% 50% at 80% 80%, rgba(94,255,164,0.18), transparent 60%),
    linear-gradient(135deg, #04081A 0%, #020410 100%);
  overflow: hidden;
}
.res-feat-cover-grid {
  position: absolute; inset: 0;
  background:
    linear-gradient(0deg,  transparent 49.5%, rgba(79,200,255,0.18) 50%, transparent 50.5%) 0 0 / 100% 11%,
    linear-gradient(90deg, transparent 49.5%, rgba(79,200,255,0.10) 50%, transparent 50.5%) 0 0 / 8.33% 100%;
  mask-image: radial-gradient(70% 70% at 50% 50%, #000 40%, transparent 100%);
}
.res-feat-cover-orb {
  position: absolute; left: 50%; top: 50%;
  width: 220px; height: 220px;
  border: 1px solid rgba(79,200,255,0.45);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow:
    inset 0 0 60px rgba(0,85,255,0.45),
    0 0 80px rgba(0,85,255,0.25);
  animation: resOrb 10s ease-in-out infinite;
}
.res-feat-cover-orb::before,
.res-feat-cover-orb::after {
  content: ""; position: absolute; inset: 18px;
  border: 1px dashed rgba(79,200,255,0.4); border-radius: 50%;
  animation: resOrbSpin 24s linear infinite;
}
.res-feat-cover-orb::after {
  inset: 38px; border-style: solid; opacity: 0.5;
  animation-direction: reverse; animation-duration: 38s;
}
@keyframes resOrb {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50%      { transform: translate(-50%, -50%) scale(1.04); }
}
@keyframes resOrbSpin { to { transform: rotate(360deg); } }
.res-feat-cover-meta {
  position: absolute; left: 24px; right: 24px; bottom: 24px; top: 24px;
  display: flex; flex-direction: column; justify-content: space-between;
  font-family: var(--font-mono);
  color: var(--site-text-3); letter-spacing: 0.16em;
  font-size: 10px;
  pointer-events: none;
}
.res-feat-tag {
  align-self: flex-start;
  border: 1px solid var(--site-cyan); color: var(--site-cyan);
  padding: 6px 10px; letter-spacing: 0.18em;
  background: rgba(0,85,255,0.08);
}
.res-feat-num {
  position: absolute; right: 0; top: 0;
  font-family: var(--font-display);
  font-size: 96px; line-height: 0.9; color: rgba(255,255,255,0.06);
  letter-spacing: -0.04em;
}
.res-feat-axis {
  display: flex; gap: 6px;
}
.res-feat-axis span {
  width: 14px; height: 1px; background: rgba(79,200,255,0.4);
}
.res-feat-axis span:nth-child(odd) { width: 22px; background: rgba(79,200,255,0.7); }

/* Featured body */
.res-feat-body {
  padding: 40px 40px 40px 8px;
  display: flex; flex-direction: column; gap: 18px;
}
.res-feat-kicker {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--site-cyan); letter-spacing: 0.18em;
}
.res-feat-ttl {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(28px, 3.4vw, 40px);
  line-height: 1.12;
  color: #fff;
  margin: 0;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.res-feat-dek {
  font-size: 16px; color: var(--site-text-2); line-height: 1.6;
  margin: 0; max-width: 56ch;
}
.res-feat-meta {
  font-family: var(--font-mono); font-size: 11px; color: var(--site-text-3);
  letter-spacing: 0.12em; display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
}
.res-feat-meta .dot { color: rgba(255,255,255,0.18); }
.res-feat-signal { display: flex; gap: 8px; flex-wrap: wrap; }
.res-chip {
  font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: 0.12em;
  padding: 5px 10px; border: 1px solid var(--site-line);
  color: var(--site-text-2);
  background: rgba(255,255,255,0.02);
}
.res-feat-ctas {
  display: flex; gap: 12px; flex-wrap: wrap;
  margin-top: 8px;
}

@media (max-width: 980px) {
  .res-feat-grid { grid-template-columns: 1fr; gap: 0; }
  .res-feat-cover { min-height: 280px; }
  .res-feat-body { padding: 32px 24px; }
}

/* Library ------------------------------------------------------ */
.res-lib {
  padding: 40px 0 100px;
  background: #050813;
  border-top: 1px solid var(--site-line);
}
.res-lib-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin: 16px 0 28px;
  border-bottom: 1px solid var(--site-line);
  padding-bottom: 12px;
  flex-wrap: wrap;
}
.res-tabs {
  display: flex; gap: 4px; flex-wrap: wrap;
}
.res-tab {
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.14em; text-transform: uppercase;
  padding: 8px 12px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--site-text-3);
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}
.res-tab:hover { color: #fff; }
.res-tab.active {
  color: #fff;
  border-color: var(--site-cyan);
  background: rgba(0,85,255,0.08);
  box-shadow: inset 0 -2px 0 var(--site-cyan);
}

.res-search {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--site-line);
  padding: 8px 12px;
  background: rgba(255,255,255,0.02);
  min-width: 280px;
}
.res-search:focus-within { border-color: var(--site-cyan); }
.res-search-ico { color: var(--site-text-3); display: inline-flex; }
.res-search input {
  background: transparent; border: 0; outline: 0; flex: 1;
  font-family: var(--font-mono); font-size: 12px;
  color: #fff; letter-spacing: 0.04em;
  /* Phase 7B: let the input shrink below its intrinsic content width so the
     ⌘K chip never spills past the bar in the 768–980px tablet band where the
     bar uses `flex: 1` and can become narrower than the input's default
     min-content width. Desktop (≥981px) is unaffected — `.res-search` is
     `min-width: 280px` there, so input has room. True mobile (<768px) hides
     this bar entirely (the .res-m-search section takes over). */
  min-width: 0;
}
.res-search input::placeholder { color: var(--site-text-3); }
.res-search-key {
  font-family: var(--font-mono); font-size: 10px; color: var(--site-text-3);
  letter-spacing: 0.12em;
  border: 1px solid var(--site-line);
  padding: 2px 6px;
}

/* Cards grid */
.res-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.res-card {
  display: flex; flex-direction: column;
  border: 1px solid var(--site-line);
  background: linear-gradient(180deg, rgba(10,15,34,0.5), rgba(2,3,10,0.3));
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
  transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.res-card:hover {
  transform: translateY(-2px);
  border-color: rgba(79,200,255,0.5);
  box-shadow: 0 24px 60px -28px rgba(0,85,255,0.5);
}
.res-card:hover .res-card-glow { opacity: 0.85; }
.res-card:hover .res-card-arrow { color: var(--site-cyan); transform: translate(2px, -2px); }

.res-card-cover {
  position: relative;
  aspect-ratio: 16 / 9;
  background:
    radial-gradient(60% 60% at 30% 30%, rgba(0,85,255,0.30), transparent 65%),
    radial-gradient(50% 50% at 75% 80%, rgba(94,255,164,0.16), transparent 65%),
    linear-gradient(135deg, #050C24 0%, #02030A 100%);
  overflow: hidden;
  border-bottom: 1px solid var(--site-line);
}
.res-card.s-sm .res-card-cover { aspect-ratio: 4 / 3; }

.res-card-grid {
  position: absolute; inset: 0;
  background:
    linear-gradient(0deg,  transparent 49.5%, rgba(79,200,255,0.10) 50%, transparent 50.5%) 0 0 / 100% 14.28%,
    linear-gradient(90deg, transparent 49.5%, rgba(79,200,255,0.08) 50%, transparent 50.5%) 0 0 / 12.5% 100%;
  mask-image: radial-gradient(70% 70% at 50% 50%, #000 50%, transparent 100%);
  opacity: 0.7;
}
.res-card-glow {
  position: absolute; left: 50%; top: 50%; width: 60%; aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid rgba(79,200,255,0.4);
  transform: translate(-50%, -50%);
  opacity: 0.55;
  box-shadow: inset 0 0 40px rgba(0,85,255,0.4);
  transition: opacity 220ms ease;
}
.res-card-glow::before {
  content: ""; position: absolute; inset: 12px;
  border: 1px dashed rgba(79,200,255,0.4);
  border-radius: 50%;
  animation: resOrbSpin 28s linear infinite;
}

/* per-card variation patterns */
.res-card-pattern {
  position: absolute; inset: 0; pointer-events: none; mix-blend-mode: screen;
}
.res-card-pattern[data-pattern="0"] {
  background:
    repeating-linear-gradient(45deg, transparent 0 8px, rgba(79,200,255,0.06) 8px 9px);
}
.res-card-pattern[data-pattern="1"] {
  background:
    repeating-linear-gradient(135deg, transparent 0 12px, rgba(94,255,164,0.05) 12px 13px);
}
.res-card-pattern[data-pattern="2"] {
  background:
    radial-gradient(2px 2px at 20% 30%, rgba(79,200,255,0.6), transparent 60%),
    radial-gradient(1.5px 1.5px at 70% 60%, rgba(255,255,255,0.5), transparent 60%),
    radial-gradient(1.5px 1.5px at 40% 80%, rgba(94,255,164,0.5), transparent 60%),
    radial-gradient(1.5px 1.5px at 85% 25%, rgba(79,200,255,0.5), transparent 60%);
}
.res-card-pattern[data-pattern="3"] {
  background:
    linear-gradient(180deg, transparent 0%, rgba(79,200,255,0.18) 50%, transparent 100%);
  background-size: 100% 30%;
  background-repeat: no-repeat;
  animation: resScanY 4.5s linear infinite;
}
@keyframes resScanY {
  0%   { background-position: 0 -30%; }
  100% { background-position: 0 130%; }
}

.res-card-tag {
  position: absolute; top: 12px; left: 12px;
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--site-cyan);
  padding: 4px 8px; border: 1px solid rgba(79,200,255,0.4);
  background: rgba(0,85,255,0.1);
}
.res-card-id {
  position: absolute; right: 12px; bottom: 10px;
  font-family: var(--font-mono); font-size: 9.5px;
  letter-spacing: 0.18em;
  color: rgba(255,255,255,0.35);
}

.res-card-body {
  padding: 16px 18px 18px;
  display: flex; flex-direction: column; gap: 8px; flex: 1;
}
.res-card-meta {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 10px;
  color: var(--site-text-3); letter-spacing: 0.14em;
  text-transform: uppercase;
}
.res-card-meta .dot { color: rgba(255,255,255,0.18); }
.res-card-ttl {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 18px;
  line-height: 1.25;
  color: #fff;
  letter-spacing: -0.01em;
  text-wrap: balance;
  margin: 0; /* h3 default reset (we changed from <div> to <h3> for semantics) */
}

.res-card-dek {
  font-size: 13px; color: var(--site-text-2); line-height: 1.55;
}
.res-card-foot {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px dashed var(--site-line);
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 10.5px;
  color: var(--site-text-3); letter-spacing: 0.12em;
}
.res-card-foot .dot { color: rgba(255,255,255,0.18); }
.res-card-arrow {
  margin-left: auto; color: var(--site-text-3);
  display: inline-flex; transition: color 200ms ease, transform 200ms ease;
}

@media (max-width: 980px) {
  .res-grid { grid-template-columns: repeat(2, 1fr); }
  .res-search { min-width: 0; flex: 1; }
}
@media (max-width: 640px) {
  .res-grid { grid-template-columns: 1fr; }
}

.res-empty {
  border: 1px dashed var(--site-line);
  padding: 60px;
  text-align: center;
  color: var(--site-text-3);
}
.res-empty-glyph { font-size: 36px; color: var(--site-text-3); }
.res-empty-ttl { color: #fff; font-family: var(--font-display); font-size: 22px; margin-top: 12px; }
.res-empty-sub { font-size: 14px; margin-top: 6px; }

/* Newsletter --------------------------------------------------- */
.res-news {
  padding: 100px 0;
  background: #03060F;
  border-top: 1px solid var(--site-line);
}
.res-news-card {
  display: grid; grid-template-columns: 1.05fr 1fr;
  gap: 0;
  border: 1px solid var(--site-line);
  background: linear-gradient(180deg, rgba(10,15,34,0.6), rgba(2,3,10,0.4));
  position: relative; overflow: hidden;
}
.res-news-card::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(40% 60% at 0% 50%, rgba(0,85,255,0.18), transparent 60%),
    radial-gradient(40% 60% at 100% 50%, rgba(94,255,164,0.10), transparent 60%);
}
.res-news-left, .res-news-right {
  position: relative; padding: 48px;
}
.res-news-left { border-right: 1px solid var(--site-line); }
.res-news-ttl {
  font-family: var(--font-display); font-weight: 300;
  font-size: clamp(26px, 3vw, 36px);
  line-height: 1.15;
  color: #fff;
  margin: 14px 0 12px;
  letter-spacing: -0.02em;
}
.res-news-dek {
  font-size: 15px; color: var(--site-text-2); line-height: 1.6; margin: 0 0 18px;
}
.res-news-list {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 10px;
  font-size: 14px; color: var(--site-text-2);
}
.res-news-list .check {
  display: inline-block; width: 18px; height: 18px;
  margin-right: 10px;
  text-align: center; line-height: 18px;
  background: rgba(94,255,164,0.12); color: var(--site-mint);
  border: 1px solid rgba(94,255,164,0.4);
  font-size: 11px;
  font-family: var(--font-mono);
}

.res-news-form { display: flex; flex-direction: column; gap: 8px; }
.res-news-form label {
  font-family: var(--font-mono); font-size: 11px; color: var(--site-text-3);
  letter-spacing: 0.16em; text-transform: uppercase;
}
.res-news-input {
  display: flex; gap: 0;
  border: 1px solid var(--site-line);
  background: rgba(255,255,255,0.02);
}
.res-news-input:focus-within { border-color: var(--site-cyan); }
.res-news-input input {
  flex: 1; background: transparent; border: 0; outline: 0;
  padding: 14px 16px; color: #fff; font-size: 14px;
  font-family: var(--font-sans);
}
.res-news-input input::placeholder { color: var(--site-text-3); }
.res-news-input button {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 22px;
  background: var(--site-blue, #0055FF);
  color: #fff;
  border: 0; cursor: pointer;
  font-family: var(--font-mono); letter-spacing: 0.12em;
  font-size: 12px; text-transform: uppercase;
}
.res-news-input button:hover { background: #4FC8FF; color: #001029; }
.res-news-fine {
  font-size: 12px; color: var(--site-text-3); line-height: 1.55; margin-top: 6px;
}

.res-news-stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  margin-top: 28px;
  border-top: 1px solid var(--site-line);
  padding-top: 18px;
}
.res-news-stats > div {
  border-right: 1px solid var(--site-line);
  padding: 0 16px;
}
.res-news-stats > div:last-child { border-right: 0; }
.res-news-stats .n {
  font-family: var(--font-display);
  font-weight: 300; font-size: 28px; color: #fff;
  letter-spacing: -0.02em;
}
.res-news-stats .l {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--site-text-3); letter-spacing: 0.16em;
  margin-top: 4px;
}

@media (max-width: 980px) {
  .res-news-card { grid-template-columns: 1fr; }
  .res-news-left { border-right: 0; border-bottom: 1px solid var(--site-line); }
  .res-news-left, .res-news-right { padding: 32px 24px; }
}

/* =========================================================================
   PHASE 3 — RESOURCES MOBILE REDESIGN
   All rules below are wrapped in @media queries so desktop is untouched.
   Naming: mobile-only sections are prefixed `.res-m-*`; CTAs + dual copy
   blocks toggle visibility via `.res-hero-sub-{desktop|mobile}` and
   `.res-news-ttl-{desktop|mobile}`.
   ========================================================================= */

/* Visually-hidden helper for labels paired with placeholders */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

/* ----- Hero: dual copy + CTAs ------------------------------------------- */
.res-hero-sub-mobile { display: none; }
.res-hero-ctas { display: none; }

@media (min-width: 768px) {
  .res-hero-sub-desktop { display: block; }
  .res-hero-sub-mobile { display: none; }
}

@media (max-width: 767px) {
  /* Compact hero on mobile — title remains H1, no extra empty space */
  .res-hero { padding: 28px 0 20px !important; }
  .res-hero h1 {
    font-size: 32px !important;
    line-height: 1.08 !important;
    margin: 10px 0 12px !important;
  }
  .res-hero-sub-desktop { display: none; }
  .res-hero-sub-mobile {
    display: block;
    font-size: 14.5px;
    line-height: 1.55;
    color: var(--site-text-2);
    margin: 0 0 18px;
    text-wrap: pretty;
  }
  .res-hero-ctas {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 4px;
  }
  .res-hero-ctas .btn {
    flex: 1 1 auto;
    min-height: 46px;
    padding: 0 16px;
    font-size: 13px;
    justify-content: center;
  }
  .res-hero-ctas .btn-primary { min-width: 60%; }

  /* The `.cmp-hero` shared chrome may set a tall min-height — clip it. */
  .res-hero.cmp-hero,
  .cmp-hero.res-hero { min-height: 0 !important; }

  /* Hide the desktop library bar's search input — the dedicated mobile
     search section above takes over. The tab strip stays. */
  .res-lib-bar .res-search { display: none !important; }
}

/* ----- Mobile search section -------------------------------------------- */
.res-m-search-section { display: none; }

@media (max-width: 767px) {
  .res-m-search-section {
    display: block;
    padding: 0 0 16px;
    background: transparent;
  }
  .res-m-search {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 52px;
    padding: 0 14px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid var(--site-line);
    border-radius: 8px;
    box-shadow: 0 1px 0 rgba(255,255,255,0.02) inset;
    transition: border-color 180ms ease, background 180ms ease;
  }
  .res-m-search:focus-within {
    border-color: var(--site-cyan);
    background: rgba(79, 200, 255, 0.04);
  }
  .res-m-search-ico {
    color: var(--site-cyan);
    display: inline-flex;
    flex: 0 0 auto;
  }
  .res-m-search input {
    flex: 1;
    background: transparent;
    border: 0; outline: 0;
    color: #fff;
    font-size: 15px; /* iOS won't auto-zoom at ≥16px; 15px is intentional, tap target is the wrapper */
    font-family: var(--font-sans, "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
    min-width: 0;
    padding: 14px 0;
  }
  .res-m-search input::placeholder {
    color: var(--site-text-3);
    font-family: var(--font-mono, "JetBrains Mono", monospace);
    font-size: 13px;
    letter-spacing: 0.04em;
  }
  .res-m-search-clear {
    appearance: none;
    background: transparent;
    border: 0;
    padding: 6px;
    color: var(--site-text-3);
    cursor: pointer;
    border-radius: 6px;
    display: inline-flex;
    align-items: center; justify-content: center;
  }
  .res-m-search-clear:focus-visible,
  .res-m-search-clear:hover {
    color: #fff;
    background: rgba(255,255,255,0.04);
    outline: none;
  }
}

/* ----- Mobile topic chips ----------------------------------------------- */
.res-m-chips-section { display: none; }

@media (max-width: 767px) {
  .res-m-chips-section {
    display: block;
    padding: 0 0 18px;
  }
  .res-m-chips-section .container {
    /* Edge-to-edge horizontal scrolling; chips bleed past container padding */
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  .res-m-chips {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 4px 20px 8px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    mask-image: linear-gradient(90deg,
      transparent 0,
      #000 16px,
      #000 calc(100% - 28px),
      transparent 100%);
    -webkit-mask-image: linear-gradient(90deg,
      transparent 0,
      #000 16px,
      #000 calc(100% - 28px),
      transparent 100%);
  }
  .res-m-chips::-webkit-scrollbar { display: none; }
  .res-m-chip {
    flex: 0 0 auto;
    scroll-snap-align: start;
    appearance: none;
    cursor: pointer;
    min-height: 38px;
    padding: 0 14px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--site-line);
    border-radius: 999px;
    color: var(--site-text-2);
    font-family: var(--font-mono, "JetBrains Mono", monospace);
    font-size: 11.5px;
    letter-spacing: 0.06em;
    white-space: nowrap;
    transition: color 180ms ease, border-color 180ms ease, background 180ms ease;
    -webkit-tap-highlight-color: transparent;
  }
  .res-m-chip:hover { color: #fff; border-color: rgba(79,200,255,0.4); }
  .res-m-chip.on {
    color: #04060F;
    background: var(--site-cyan, #4FC8FF);
    border-color: var(--site-cyan, #4FC8FF);
  }
  .res-m-chip:focus-visible {
    outline: 2px solid var(--site-cyan, #4FC8FF);
    outline-offset: 2px;
  }
}

/* ----- Mobile "Start here" ---------------------------------------------- */
.res-m-qs-section { display: none; }

@media (max-width: 767px) {
  .res-m-qs-section {
    display: block;
    padding: 4px 0 24px;
  }
  .res-m-qs-eyebrow {
    font-family: var(--font-mono, "JetBrains Mono", monospace);
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--site-cyan, #4FC8FF);
    margin: 0 0 12px;
  }
  .res-m-qs-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .res-m-qs-card {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: start;
    gap: 14px;
    padding: 16px 18px;
    border: 1px solid var(--site-line);
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(255,255,255,0.025), rgba(255,255,255,0.012));
    color: #fff;
    text-decoration: none;
    transition: border-color 200ms ease, transform 200ms ease, background 200ms ease;
    -webkit-tap-highlight-color: transparent;
  }
  .res-m-qs-card:hover,
  .res-m-qs-card:focus-visible {
    border-color: rgba(79,200,255,0.55);
    background: linear-gradient(180deg, rgba(79,200,255,0.07), rgba(79,200,255,0.02));
    outline: none;
  }
  .res-m-qs-num {
    font-family: var(--font-mono, "JetBrains Mono", monospace);
    font-size: 10.5px;
    letter-spacing: 0.16em;
    color: var(--site-cyan, #4FC8FF);
    background: rgba(79,200,255,0.08);
    border: 1px solid rgba(79,200,255,0.25);
    padding: 4px 6px;
    border-radius: 4px;
    line-height: 1;
  }
  .res-m-qs-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
  .res-m-qs-ttl {
    margin: 0;
    font-family: var(--font-display, "Inter", -apple-system, BlinkMacSystemFont, sans-serif);
    font-weight: 500;
    font-size: 15.5px;
    line-height: 1.25;
    color: #fff;
    letter-spacing: -0.005em;
  }
  .res-m-qs-txt {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--site-text-2);
  }
  .res-m-qs-cta {
    margin-top: 6px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono, "JetBrains Mono", monospace);
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--site-cyan, #4FC8FF);
  }
}

/* ----- Mobile "Browse by category" -------------------------------------- */
.res-m-cats-section { display: none; }

@media (max-width: 767px) {
  .res-m-cats-section {
    display: block;
    padding: 4px 0 24px;
  }
  .res-m-cats-eyebrow {
    font-family: var(--font-mono, "JetBrains Mono", monospace);
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--site-text-3);
    margin: 0 0 12px;
  }
  .res-m-cats-grid {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--site-line);
    border-radius: 10px;
    background: rgba(255,255,255,0.02);
    overflow: hidden;
  }
  .res-m-cat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 56px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--site-line);
    color: #fff;
    text-decoration: none;
    transition: background 180ms ease, color 180ms ease;
    -webkit-tap-highlight-color: transparent;
  }
  .res-m-cat:last-child { border-bottom: 0; }
  .res-m-cat:hover,
  .res-m-cat:focus-visible {
    background: rgba(79,200,255,0.05);
    outline: none;
  }
  .res-m-cat-l {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
  }
  .res-m-cat-n {
    font-family: var(--font-mono, "JetBrains Mono", monospace);
    font-size: 10px;
    letter-spacing: 0.14em;
    color: var(--site-text-3);
    flex: 0 0 auto;
  }
  .res-m-cat-label {
    font-size: 14.5px;
    font-weight: 500;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .res-m-cat-r {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--site-text-3);
    flex: 0 0 auto;
  }
  .res-m-cat-tag {
    font-family: var(--font-mono, "JetBrains Mono", monospace);
    font-size: 10.5px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--site-text-3);
  }
}

/* ----- Mobile featured: compact treatment ------------------------------- */
@media (max-width: 767px) {
  .res-featured { padding: 8px 0 28px !important; border-top: 0 !important; }
  .res-feat-grid { gap: 0 !important; }
  /* Hide the giant decorative cover; show a small inline tag row instead */
  .res-feat-cover {
    min-height: 0 !important;
    aspect-ratio: 16 / 7 !important;
    border-radius: 8px !important;
  }
  .res-feat-cover-orb { width: 120px !important; height: 120px !important; }
  .res-feat-cover-meta { left: 14px !important; right: 14px !important; top: 12px !important; bottom: 12px !important; }
  .res-feat-num { font-size: 28px !important; }
  .res-feat-body {
    padding: 18px 4px 4px !important;
    gap: 12px !important;
  }
  .res-feat-kicker { font-size: 10.5px !important; }
  .res-feat-ttl {
    font-size: 22px !important;
    line-height: 1.18 !important;
    -webkit-line-clamp: 4;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .res-feat-dek {
    font-size: 13.5px !important;
    line-height: 1.55 !important;
    -webkit-line-clamp: 2;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .res-feat-signal { display: none !important; } /* signal chips — desktop-only colour */
  .res-feat-meta { font-size: 10.5px !important; }
  .res-feat-ctas .btn { min-height: 44px; flex: 1 1 auto; font-size: 12.5px; }
}

/* ----- Mobile library section padding ----------------------------------- */
@media (max-width: 767px) {
  .res-lib { padding: 8px 0 28px !important; border-top: 0 !important; }
  .res-lib-bar { margin: 4px 0 14px !important; }
}

/* ----- Mobile newsletter: dual copy, single column, compact ------------- */
.res-news-ttl-mobile { display: none; }

@media (min-width: 768px) {
  .res-news-ttl-desktop { display: block; }
  .res-news-ttl-mobile { display: none; }
}

@media (max-width: 767px) {
  .res-news { padding: 32px 0 40px !important; }
  .res-news-card { grid-template-columns: 1fr !important; }
  .res-news-left,
  .res-news-right {
    padding: 22px 18px !important;
    border-right: 0 !important;
    border-bottom: 0 !important;
  }
  .res-news-left { border-bottom: 1px solid var(--site-line) !important; }
  .res-news-ttl-desktop { display: none; }
  .res-news-ttl-mobile {
    display: block;
    font-family: var(--font-display, "Inter", -apple-system, sans-serif);
    font-weight: 400;
    font-size: 22px !important;
    line-height: 1.18 !important;
    letter-spacing: -0.015em;
    color: #fff;
    margin: 6px 0 10px;
  }
  .res-news-dek {
    font-size: 13.5px !important;
    line-height: 1.55 !important;
    margin-bottom: 12px !important;
  }
  /* Trim the bullet list on mobile — keep first two, hide third for breathing room */
  .res-news-list { font-size: 13px !important; gap: 6px !important; }
  .res-news-list li:nth-child(n+3) { display: none; }
  .res-news-input { flex-direction: column; border: 0; background: transparent; }
  .res-news-input input {
    border: 1px solid var(--site-line);
    background: rgba(255,255,255,0.02);
    padding: 14px 14px !important;
    border-radius: 6px;
    font-size: 14px;
  }
  .res-news-input button {
    margin-top: 8px;
    padding: 14px 18px !important;
    min-height: 46px;
    justify-content: center;
    border-radius: 6px;
  }
  .res-news-fine { font-size: 11.5px !important; line-height: 1.5; }
  .res-news-stats { margin-top: 18px !important; }
  .res-news-stats .n { font-size: 22px !important; }
  .res-news-stats .l { font-size: 9.5px !important; }
}

/* ----- Sticky-CTA spacing safety — last section before footer ----------- */
@media (max-width: 767px) {
  body.bgsc-has .res-news { padding-bottom: 56px !important; }
}

/* ----- Footer accordion (mobile only, Resources page) ------------------
   Body class `res-page-mobile` is added by resources.jsx on mount when the
   viewport is mobile. We collapse the link columns into accordions; the
   brand column stays full-height. The JS effect adds/removes `.foot-col-open`
   when the heading is tapped. */
@media (max-width: 767px) {
  body.res-page-mobile .foot-grid {
    grid-template-columns: 1fr !important;
    gap: 0 !important;
  }
  body.res-page-mobile .foot-col {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding: 0 !important;
  }
  body.res-page-mobile .foot-col h5 {
    margin: 0 !important;
    padding: 16px 28px 16px 0 !important;
    position: relative;
    cursor: pointer;
    user-select: none;
  }
  body.res-page-mobile .foot-col h5::after {
    content: "+";
    position: absolute;
    right: 0; top: 50%;
    transform: translateY(-50%);
    font-family: var(--font-mono, monospace);
    font-size: 18px;
    color: var(--site-text-3);
    transition: transform 200ms ease;
  }
  body.res-page-mobile .foot-col ul {
    max-height: 0;
    overflow: hidden;
    transition: max-height 260ms ease;
    margin: 0 !important;
    padding: 0 !important;
  }
  body.res-page-mobile .foot-col.foot-col-open ul {
    max-height: 800px;
    padding-bottom: 14px !important;
  }
  body.res-page-mobile .foot-col.foot-col-open h5::after {
    transform: translateY(-50%) rotate(45deg);
  }
}
