/* ============================================================
   Signal Scout — design system
   Palette & type discipline modeled on apple.com dark surfaces:
   near-black canvas, hairline borders, one blue, lots of quiet.
   ============================================================ */

:root {
  --bg: #050507;
  --surface: #101012;
  --surface-2: #17171a;
  --border: rgba(255, 255, 255, .09);
  --border-strong: rgba(255, 255, 255, .16);
  --text: #f5f5f7;
  --muted: #a1a1a6;
  --muted-2: #6e6e73;
  --blue: #0a84ff;
  --blue-soft: #2997ff;
  --red: #ff453a;
  --nav-bg: rgba(5, 5, 7, .68);
  --hero-from: #ffffff;
  --hero-to: #b8b8bf;
  --on-invert: #0a0a0b;
  --card-shadow: 0 24px 48px -24px rgba(0, 0, 0, .8);
  /* Liquid glass material */
  --glass-tint: rgba(255, 255, 255, .06);
  --glass-tint-strong: rgba(255, 255, 255, .12);
  --glass-border: rgba(255, 255, 255, .16);
  --glass-highlight: rgba(255, 255, 255, .28);
  --card-bg: rgba(18, 18, 23, .7);
  --input-bg: rgba(0, 0, 0, .32);
  --blob-opacity: .5;
  --radius: 18px;
  --radius-sm: 10px;
  --ease: 240ms cubic-bezier(.32, .72, .27, 1);
  --ease-slow: 600ms cubic-bezier(.32, .72, .27, 1);
  color-scheme: dark;
}

html[data-theme="light"] {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-2: #ececef;
  --border: rgba(0, 0, 0, .09);
  --border-strong: rgba(0, 0, 0, .18);
  --text: #1d1d1f;
  --muted: #515154;
  --muted-2: #86868b;
  --blue: #0071e3;
  --blue-soft: #0066cc;
  --red: #de3618;
  --nav-bg: rgba(245, 245, 247, .72);
  --hero-from: #1d1d1f;
  --hero-to: #56565c;
  --on-invert: #f5f5f7;
  --card-shadow: 0 24px 48px -28px rgba(0, 0, 0, .22);
  --glass-tint: rgba(255, 255, 255, .42);
  --glass-tint-strong: rgba(255, 255, 255, .62);
  --glass-border: rgba(0, 0, 0, .1);
  --glass-highlight: rgba(255, 255, 255, .95);
  --card-bg: rgba(255, 255, 255, .64);
  --input-bg: rgba(255, 255, 255, .72);
  --blob-opacity: .42;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  font-size: 15.5px;
  line-height: 1.55;
  letter-spacing: -.006em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

h1, h2, h3 {
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -.028em;
  margin: 0;
}

:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 6px; }

::selection { background: rgba(10, 132, 255, .32); }

/* ---------- Motion ---------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Animated background (iPhone-wallpaper style) ---------- */
.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  filter: blur(90px) saturate(140%);
}
.bg-blob {
  position: absolute;
  border-radius: 50%;
  opacity: var(--blob-opacity);
  will-change: transform;
}
.bg-blob-1 {
  width: 55vmax; height: 55vmax; top: -18%; left: -12%;
  background: radial-gradient(circle at 32% 32%, #0a84ff, transparent 68%);
  animation: drift-1 38s ease-in-out infinite alternate;
}
.bg-blob-2 {
  width: 48vmax; height: 48vmax; top: 4%; right: -16%;
  background: radial-gradient(circle at 60% 40%, #bf5af2, transparent 68%);
  animation: drift-2 47s ease-in-out infinite alternate;
}
.bg-blob-3 {
  width: 50vmax; height: 50vmax; bottom: -22%; left: 8%;
  background: radial-gradient(circle at 40% 60%, #64d2ff, transparent 68%);
  animation: drift-3 55s ease-in-out infinite alternate;
}
.bg-blob-4 {
  width: 34vmax; height: 34vmax; top: 42%; left: 42%;
  background: radial-gradient(circle at 50% 50%, #ff375f, transparent 66%);
  animation: drift-4 62s ease-in-out infinite alternate;
  opacity: calc(var(--blob-opacity) * .6);
}
@keyframes drift-1 {
  from { transform: translate(-6%, -8%) scale(1) rotate(0deg); }
  to   { transform: translate(14%, 10%) scale(1.2) rotate(40deg); }
}
@keyframes drift-2 {
  from { transform: translate(6%, -4%) scale(1.1) rotate(0deg); }
  to   { transform: translate(-12%, 14%) scale(.92) rotate(-35deg); }
}
@keyframes drift-3 {
  from { transform: translate(-4%, 6%) scale(.95) rotate(0deg); }
  to   { transform: translate(12%, -10%) scale(1.18) rotate(30deg); }
}
@keyframes drift-4 {
  from { transform: translate(-10%, 8%) scale(1) ; }
  to   { transform: translate(12%, -12%) scale(1.25); }
}

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .8rem clamp(1rem, 4vw, 2.6rem);
  background: var(--nav-bg);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  border-bottom: 1px solid var(--border);
}
.brand {
  display: inline-flex; align-items: center; gap: .6rem;
  font-weight: 700; font-size: 1.02rem; letter-spacing: -.02em;
}
.brand svg { flex: none; color: var(--text); }
.nav-links { display: flex; gap: .2rem; }
.nav-links a {
  padding: .42rem .95rem;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 500;
  font-size: .9rem;
  transition: color var(--ease), background var(--ease);
  cursor: pointer;
}
.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: var(--on-invert); background: var(--text); font-weight: 600; }

.nav-right { display: flex; align-items: center; gap: .4rem; }
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; padding: 0;
  background: linear-gradient(180deg, var(--glass-tint), transparent);
  border: 1px solid var(--glass-border); border-radius: 50%;
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  box-shadow: inset 0 1px 0 var(--glass-highlight);
  color: var(--muted); cursor: pointer;
  transition: color var(--ease), border-color var(--ease), transform var(--ease);
}
.theme-toggle:hover { color: var(--text); border-color: var(--border-strong); transform: scale(1.06); }
.theme-toggle svg { width: 15px; height: 15px; }
.theme-toggle .icon-sun { display: block; }
.theme-toggle .icon-moon { display: none; }
html[data-theme="light"] .theme-toggle .icon-sun { display: none; }
html[data-theme="light"] .theme-toggle .icon-moon { display: block; }

/* ---------- Layout ---------- */
.container {
  width: 100%; max-width: 1140px; margin: 0 auto;
  padding: clamp(1.6rem, 4vw, 3.2rem) clamp(1rem, 4vw, 2rem);
  flex: 1;
}
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem;
  animation: rise .5s var(--ease-slow) both;
}
.page-head h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); }
.sub { color: var(--muted); margin: .45rem 0 0; font-size: .98rem; }
.narrow { max-width: 700px; margin: 0 auto; animation: rise .5s var(--ease-slow) both; }
.narrow h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .68rem 1.35rem;
  border-radius: 999px;
  font-family: inherit;
  font-weight: 600; font-size: .93rem; letter-spacing: -.01em;
  border: 1px solid transparent;
  cursor: pointer;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  transition: transform var(--ease), opacity var(--ease), background var(--ease),
              border-color var(--ease), box-shadow var(--ease);
}
.btn:hover { transform: scale(1.03); }
.btn:active { transform: scale(.97); }
.btn-primary {
  background: linear-gradient(180deg, rgba(64, 156, 255, .9), rgba(10, 108, 245, .78));
  border-color: rgba(255, 255, 255, .3);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45),
              inset 0 -1px 1px rgba(255, 255, 255, .1),
              0 10px 30px -8px rgba(10, 132, 255, .55);
}
.btn-primary:hover {
  background: linear-gradient(180deg, rgba(84, 168, 255, .95), rgba(22, 118, 250, .85));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55),
              inset 0 -1px 1px rgba(255, 255, 255, .12),
              0 14px 36px -8px rgba(10, 132, 255, .65);
}
.btn-ghost {
  background: linear-gradient(180deg, var(--glass-tint-strong), var(--glass-tint));
  border-color: var(--glass-border);
  color: var(--text);
  box-shadow: inset 0 1px 0 var(--glass-highlight),
              0 8px 24px -14px rgba(0, 0, 0, .5);
}
.btn-ghost:hover { border-color: var(--border-strong); }

/* ---------- Hero ---------- */
.hero { padding: clamp(2rem, 7vw, 4.5rem) 0 1.5rem; max-width: 780px; }
.hero > * { animation: rise .6s var(--ease-slow) both; }
.hero > *:nth-child(2) { animation-delay: .06s; }
.hero > *:nth-child(3) { animation-delay: .12s; }
.hero > *:nth-child(4) { animation-delay: .18s; }
.hero > *:nth-child(5) { animation-delay: .24s; }
.hero-badge {
  display: inline-flex; align-items: center; gap: .45rem;
  font-size: .8rem; font-weight: 500; letter-spacing: .01em;
  color: var(--muted);
  border: 1px solid var(--border-strong);
  padding: .32rem .8rem; border-radius: 999px; margin-bottom: 1.4rem;
}
.hero-badge::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--blue-soft);
}
.hero-title {
  font-size: clamp(2.3rem, 6.5vw, 3.9rem);
  font-weight: 800;
  letter-spacing: -.035em;
  margin-bottom: 1.1rem;
  background: linear-gradient(180deg, var(--hero-from) 55%, var(--hero-to));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-lead { font-size: clamp(1.02rem, 2.4vw, 1.22rem); font-weight: 450; color: var(--muted); margin: 0 0 1.8rem; }
.hero-cta { display: flex; gap: .75rem; flex-wrap: wrap; }
.hero-note { color: var(--muted-2); font-size: .86rem; margin-top: 1.3rem; }

/* ---------- Module cards (landing) ---------- */
.modules {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: .9rem; margin: 3rem 0;
}
.module {
  display: flex; flex-direction: column;
  padding: 1.6rem; border: 1px solid var(--glass-border); border-radius: var(--radius);
  background: linear-gradient(180deg, var(--glass-tint-strong), var(--glass-tint));
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  box-shadow: inset 0 1px 0 var(--glass-highlight);
  transition: transform var(--ease), border-color var(--ease), background var(--ease);
  cursor: pointer;
  animation: rise .6s var(--ease-slow) both;
}
.module:nth-child(2) { animation-delay: .08s; }
.module:nth-child(3) { animation-delay: .16s; }
.module:hover { transform: translateY(-4px); border-color: var(--border-strong); }
.module h3 { font-size: 1.22rem; margin-bottom: .55rem; }
.module p { margin: 0 0 1.2rem; color: var(--muted); font-size: .93rem; flex: 1; }
.module-go { color: var(--blue-soft); font-weight: 600; font-size: .9rem; transition: transform var(--ease); }
.module:hover .module-go { transform: translateX(3px); }

/* ---------- Highlight sections ---------- */
.highlight { margin: 3rem 0 0; }
.highlight-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 1.1rem;
}
.highlight-head h2 { font-size: 1.45rem; }
.highlight-head a { color: var(--blue-soft); font-size: .9rem; font-weight: 600; cursor: pointer; }
.highlight-head a:hover { text-decoration: underline; }

/* ---------- Chips (filters) ---------- */
.chips { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: 1.7rem; }
.chip {
  padding: .4rem 1rem; border-radius: 999px; font-size: .87rem; font-weight: 500;
  color: var(--muted);
  background: linear-gradient(180deg, var(--glass-tint), transparent);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  box-shadow: inset 0 1px 0 var(--glass-highlight);
  transition: color var(--ease), background var(--ease), border-color var(--ease), transform var(--ease);
  cursor: pointer;
}
.chip:hover { color: var(--text); border-color: var(--border-strong); transform: translateY(-1px); }
.chip-active { color: var(--on-invert); background: var(--text); border-color: var(--text); font-weight: 600; }

/* ---------- Card grid ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; }
.grid .card { animation: rise .55s var(--ease-slow) both; }
.grid .card:nth-child(2)  { animation-delay: .04s; }
.grid .card:nth-child(3)  { animation-delay: .08s; }
.grid .card:nth-child(4)  { animation-delay: .12s; }
.grid .card:nth-child(5)  { animation-delay: .16s; }
.grid .card:nth-child(6)  { animation-delay: .20s; }
.grid .card:nth-child(n+7) { animation-delay: .24s; }

.card {
  display: flex; flex-direction: column;
  background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: inset 0 1px 0 var(--glass-tint);
  overflow: hidden;
  transition: transform var(--ease), border-color var(--ease), box-shadow var(--ease);
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: var(--card-shadow);
}
.card-cover {
  position: relative; display: block; height: 158px;
  background-color: var(--surface-2); background-size: cover; background-position: center;
  overflow: hidden;
}
.card-cover::before {
  content: ""; position: absolute; inset: 0;
  background: inherit; background-size: cover; background-position: center;
  transition: transform var(--ease-slow);
}
.card:hover .card-cover::before { transform: scale(1.05); }
.card-cat {
  position: absolute; z-index: 1; top: .65rem; left: .65rem;
  font-size: .7rem; font-weight: 600; letter-spacing: .03em;
  color: rgba(255, 255, 255, .92); background: rgba(0, 0, 0, .5);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  padding: .22rem .6rem; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .14);
}
.cover-word {
  position: absolute; z-index: 1; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.45rem; letter-spacing: -.02em;
  color: rgba(255, 255, 255, .28);
}
.card-body { padding: 1rem 1.05rem 1rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.card-meta {
  display: flex; align-items: center; justify-content: space-between;
  font-size: .76rem; color: var(--muted-2); letter-spacing: .01em;
}
.card-meta .score {
  font-weight: 600; color: var(--muted);
  border: 1px solid var(--border); border-radius: 999px; padding: .06rem .5rem;
  font-variant-numeric: tabular-nums;
}
.card-title {
  font-weight: 600; font-size: 1.04rem; line-height: 1.32; letter-spacing: -.015em;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  transition: color var(--ease); cursor: pointer;
}
.card-title:hover { color: var(--blue-soft); }
.card-summary {
  margin: 0; font-size: .9rem; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.card-foot {
  margin-top: auto; padding-top: .65rem; border-top: 1px solid var(--border);
  display: flex; align-items: flex-start; justify-content: space-between; gap: .8rem;
}
.card-more { flex: 1; min-width: 0; }
.card-more summary {
  cursor: pointer; font-size: .84rem; font-weight: 600; color: var(--muted);
  list-style: none; transition: color var(--ease);
}
.card-more summary:hover { color: var(--text); }
.card-more summary::-webkit-details-marker { display: none; }
.card-more summary::after { content: " +"; color: var(--muted-2); }
.card-more[open] summary::after { content: " \2212"; }
.card-more p { font-size: .88rem; color: var(--muted); margin: .6rem 0 0; }
.card-more .why strong { color: var(--text); }
.card-more .ref { display: inline-block; margin-top: .6rem; color: var(--blue-soft); font-size: .85rem; font-weight: 600; }
.card-more .ref:hover { text-decoration: underline; }

/* ---------- Reactions ---------- */
.card-actions { display: flex; gap: .3rem; flex: none; }
.react {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; padding: 0;
  background: transparent; border: none; border-radius: 50%;
  color: var(--muted-2); cursor: pointer;
  transition: color var(--ease), background var(--ease), transform var(--ease);
}
.react svg { width: 16px; height: 16px; }
.react:hover { background: var(--surface-2); color: var(--text); transform: scale(1.1); }
.react:active { transform: scale(.92); }
.react.like.active { color: var(--blue-soft); }
.react.dislike.active { color: var(--red); }

.empty {
  color: var(--muted); background: var(--card-bg);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px dashed var(--border-strong); border-radius: var(--radius);
  padding: 2.2rem; text-align: center;
}

/* ---------- Prose (reports / results) ---------- */
.prose {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  box-shadow: inset 0 1px 0 var(--glass-tint);
  padding: clamp(1.3rem, 4vw, 2.2rem);
  animation: rise .5s var(--ease-slow) both;
}
.prose h1 { font-size: 1.65rem; margin-bottom: 1rem; }
.prose h2 { font-size: 1.22rem; margin: 1.7rem 0 .7rem; padding-bottom: .45rem; border-bottom: 1px solid var(--border); }
.prose h3 { font-size: 1.04rem; margin: 1.2rem 0 .5rem; }
.prose p, .prose li { color: var(--muted); }
.prose strong { color: var(--text); }
.prose a { color: var(--blue-soft); }
.prose a:hover { text-decoration: underline; }
.prose ul { padding-left: 1.2rem; }
.prose li { margin: .35rem 0; }

/* ---------- Forms ---------- */
.form {
  display: flex; flex-direction: column; gap: 1.15rem;
  background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  box-shadow: inset 0 1px 0 var(--glass-tint);
  padding: clamp(1.3rem, 4vw, 1.9rem); margin-top: 1.5rem;
}
.field { display: flex; flex-direction: column; gap: .45rem; }
.field > span { font-size: .89rem; font-weight: 600; }
.field input[type=file], .field textarea {
  background: var(--input-bg); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  color: var(--text); padding: .72rem .85rem;
  font-family: inherit; font-size: .95rem;
  transition: border-color var(--ease);
}
.field textarea { resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--blue); outline: none; }
.field .optional {
  font-style: normal; font-weight: 500; font-size: .76rem;
  color: var(--muted-2); margin-left: .3rem;
  border: 1px solid var(--border); border-radius: 999px; padding: .06rem .5rem;
}
.divider {
  display: flex; align-items: center; gap: .8rem;
  color: var(--muted-2); font-size: .78rem; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
}
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.check { display: flex; align-items: center; gap: .55rem; font-size: .91rem; color: var(--muted); cursor: pointer; }
.check input { accent-color: var(--blue); width: 1.05rem; height: 1.05rem; cursor: pointer; }
.hint { font-size: .82rem; color: var(--muted-2); margin: 0; }
.back { display: inline-block; margin-bottom: 1rem; color: var(--muted); font-size: .9rem; cursor: pointer; transition: color var(--ease); }
.back:hover { color: var(--text); }
.subject { font-style: italic; margin-bottom: 1.2rem; }
.login-wrap { max-width: 420px; margin: 12vh auto 0; text-align: center; animation: rise .5s var(--ease-slow) both; }
.login-wrap h1 { font-size: 2rem; }
.login-wrap .form { text-align: left; }

/* ---------- Footer ---------- */
.footer {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: 1.7rem clamp(1rem, 4vw, 2.6rem);
  border-top: 1px solid var(--border);
  color: var(--muted-2); font-size: .84rem; margin-top: 2.5rem;
}
.footer > span:first-child { font-weight: 600; color: var(--muted); }

/* ---------- Topic takeover ---------- */
@keyframes slidein {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: none; }
}
.topic-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1.6rem;
  align-items: start; margin-top: .5rem;
}
.topic-main { animation: rise .5s var(--ease-slow) both; min-width: 0; }
.topic-hero {
  position: relative; height: 240px; border-radius: var(--radius);
  background-size: cover; background-position: center;
  background-color: var(--surface-2); border: 1px solid var(--border);
  overflow: hidden; margin-bottom: 1.1rem;
}
.topic-meta { font-size: .82rem; color: var(--muted-2); }
.topic-meta .score { color: var(--blue-soft); font-weight: 600; }
.topic-title { font-size: clamp(1.6rem, 4vw, 2.3rem); margin: .5rem 0 1rem; letter-spacing: -.03em; }
.topic-open { margin-bottom: 1.5rem; }
.topic-detail { margin-top: 0; }

.sidepanel {
  position: sticky; top: 84px;
  background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius);
  backdrop-filter: blur(24px) saturate(160%); -webkit-backdrop-filter: blur(24px) saturate(160%);
  box-shadow: inset 0 1px 0 var(--glass-tint);
  padding: 1.1rem; display: flex; flex-direction: column; gap: .3rem;
  animation: slidein .55s var(--ease-slow) both;
}
.sidepanel-head {
  font-size: .78rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted-2); margin-bottom: .6rem;
}
.related {
  display: flex; flex-direction: column; gap: .2rem;
  padding: .7rem; border-radius: var(--radius-sm);
  transition: background var(--ease); cursor: pointer;
}
.related:hover { background: var(--surface-2); }
.related-cat {
  font-size: .68rem; font-weight: 600; letter-spacing: .04em; color: var(--blue-soft);
  text-transform: uppercase;
}
.related-title {
  font-size: .9rem; font-weight: 500; line-height: 1.3; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.related-src { font-size: .74rem; color: var(--muted-2); }
.brief-loading { display: flex; align-items: center; gap: .6rem; color: var(--muted); }
.spinner { width: 16px; height: 16px; border-radius: 50%; flex: none;
  border: 2px solid var(--border-strong); border-top-color: var(--blue-soft);
  animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .topic-layout { grid-template-columns: 1fr; }
  .sidepanel { position: static; }
}
@media (max-width: 640px) {
  .nav { flex-direction: column; align-items: stretch; gap: .55rem; padding-bottom: .55rem; }
  .nav-right { justify-content: center; }
  .nav-links { justify-content: center; }
  .page-head { align-items: flex-start; }
  .grid { grid-template-columns: 1fr; }
  .hero-cta .btn { flex: 1; }
}
