:root {
  --bg: #090b12;
  --panel: rgba(15, 18, 32, 0.88);
  --panel-2: rgba(14, 20, 40, 0.92);
  --text: #d8ecff;
  --muted: #84a4c8;
  --cyan: #33f0ff;
  --magenta: #ff3cac;
  --lime: #7bffb2;
  --border: rgba(51, 240, 255, 0.2);
  --glow: 0 0 30px rgba(51, 240, 255, 0.15);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--text);
  background: radial-gradient(circle at top, #11182f 0%, #090b12 55%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
}
.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(51,240,255,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(51,240,255,0.06) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(circle at center, black 50%, transparent 100%);
  pointer-events: none;
}
.topbar, .layout, .blog-layout { position: relative; z-index: 1; }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
  padding: 36px 40px 24px;
  max-width: 1400px;
  margin: 0 auto;
}
.topbar nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
}
.eyebrow, .label { text-transform: uppercase; letter-spacing: 0.18em; color: var(--cyan); font-size: 12px; }
h1, h2, h3, p { margin-top: 0; }
.subtitle { color: var(--muted); max-width: 760px; }
.nav-link {
  color: var(--muted);
  text-decoration: none;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: 999px;
}
.nav-link.active, .nav-link:hover { color: var(--text); border-color: var(--border); background: rgba(51,240,255,0.08); }
.layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  padding: 0 40px 40px;
  max-width: 1400px;
  margin: 0 auto;
}
.blog-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.9fr) minmax(300px, 0.9fr);
  gap: 24px;
  padding: 0 40px 40px;
  max-width: 1400px;
  margin: 0 auto;
}
.card {
  background: linear-gradient(180deg, rgba(15, 18, 32, 0.92), rgba(10, 14, 26, 0.94));
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--glow);
  backdrop-filter: blur(14px);
}
.glow { box-shadow: 0 0 40px rgba(255, 60, 172, 0.12), var(--glow); }
.hero, .wide { grid-column: 1 / -1; }
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  align-items: start;
  gap: 24px;
  min-height: 300px;
  background: linear-gradient(135deg, rgba(13,19,34,0.95), rgba(27,12,35,0.95));
}
.hero-main {
  min-width: 0;
}
.hero-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
.hero-side-compact {
  justify-content: flex-start;
  width: 100%;
}
.hero-text-only {
  align-items: start;
}
.hero-score {
  min-width: 220px;
  text-align: left;
  border: 1px solid rgba(255,60,172,0.2);
  border-radius: 22px;
  padding: 24px;
  background: rgba(255,60,172,0.07);
}
.hero-score span {
  display: block;
  margin-bottom: 8px;
}
.hero-score strong {
  font-size: 56px;
  color: var(--lime);
  display: block;
  line-height: 1;
}
.hero-score small {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip, .pill {
  display: inline-flex;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--cyan);
  background: rgba(51,240,255,0.08);
  font-size: 13px;
}
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.metric-card {
  background: linear-gradient(180deg, rgba(18,27,48,0.92), rgba(14,18,28,0.92));
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 20px;
  padding: 18px 20px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03), var(--glow);
}
.metric-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.metric-card strong {
  font-size: 34px;
  color: var(--text);
}
.intel-ribbon {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  background: linear-gradient(90deg, rgba(14,24,42,0.95), rgba(42,13,42,0.95));
}
.blog-cover {
  min-height: 260px;
  border-radius: 22px;
  margin-bottom: 26px;
  background: radial-gradient(circle at top left, rgba(51,240,255,0.20), transparent 28%), linear-gradient(135deg, rgba(19,29,50,0.96), rgba(47,16,48,0.88));
  border: 1px solid rgba(51,240,255,0.14);
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(220px, 0.75fr);
  gap: 20px;
  padding: 26px;
  overflow: hidden;
}
.blog-cover-text-only {
  grid-template-columns: 1fr;
  min-height: 0;
}
.blog-cover-copy {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.blog-cover-copy-full {
  max-width: 72ch;
}
.blog-hero-copy { display: flex; gap: 10px; flex-wrap: wrap; }
.blog-excerpt {
  color: #d2e3f7;
  max-width: 54ch;
  margin: 12px 0 0;
  font-size: 16px;
}
.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
}
.section-head span, .section-head a { color: var(--muted); }
.stack { display: grid; gap: 16px; }
.dashboard-column {
  display: flex;
  flex-direction: column;
  min-height: 780px;
}
.filter-row {
  margin-bottom: 16px;
}
.filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.dashboard-filter-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(180px, 1fr)) auto;
  gap: 12px;
  align-items: end;
}
.filter-control {
  display: grid;
  gap: 8px;
}
.filter-control select,
.filter-control input {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(51,240,255,0.18);
  background: rgba(12, 18, 34, 0.92);
  color: var(--text);
  padding: 12px 14px;
  font: inherit;
}
.filter-actions {
  display: flex;
  align-items: end;
}
.filter-reset {
  border: 1px solid rgba(51,240,255,0.18);
  background: rgba(51,240,255,0.08);
  color: var(--text);
  border-radius: 14px;
  padding: 12px 16px;
  font: inherit;
  cursor: pointer;
}
.scroll-stack {
  flex: 1 1 auto;
  min-height: 0;
  max-height: 640px;
  overflow: auto;
  padding-right: 6px;
}
.scroll-stack::-webkit-scrollbar {
  width: 10px;
}
.scroll-stack::-webkit-scrollbar-thumb {
  background: rgba(51,240,255,0.18);
  border-radius: 999px;
}
.item {
  border: 1px solid rgba(132,164,200,0.14);
  border-radius: 18px;
  padding: 18px;
  background: linear-gradient(180deg, rgba(18, 24, 45, 0.92), rgba(13, 18, 35, 0.96));
}
.item p { margin-bottom: 0; }
.archive-button {
  width: 100%;
  text-align: left;
  color: var(--text);
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}
.archive-button:hover {
  transform: translateY(-1px);
  border-color: rgba(51,240,255,0.28);
  box-shadow: 0 0 20px rgba(51,240,255,0.08);
}
.item h4 { margin-bottom: 8px; }
.meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; color: var(--muted); font-size: 14px; align-items: center; }
.score { color: var(--lime); font-weight: 700; }
.card-link {
  color: var(--text);
  text-decoration: none;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
  text-align: left;
}
.card-link:hover {
  color: var(--cyan);
}
.clickable-card {
  transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease, background 120ms ease, opacity 120ms ease;
}
.clickable-card:hover {
  transform: translateY(-1px);
  border-color: rgba(51,240,255,0.28);
  box-shadow: 0 0 22px rgba(51,240,255,0.08);
}
.clickable-card.is-read {
  border-color: rgba(123,255,178,0.24);
  background: linear-gradient(180deg, rgba(20, 31, 42, 0.96), rgba(14, 22, 30, 0.96));
}
.clickable-card.is-read .card-link {
  color: #bfeecf;
}
.story-link {
  color: var(--cyan);
  text-decoration: none;
  font-weight: 600;
}
.story-link:hover {
  text-decoration: underline;
}
.editorial, .blog-body { color: #c7dbef; white-space: pre-wrap; }
.blog-date {
  color: var(--muted);
  margin: -6px 0 18px;
  font-size: 14px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.blog-image-credit-wrap {
  margin: -6px 0 20px;
}
.image-credit {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
}
.image-credit:hover {
  color: var(--cyan);
}
.blog-body {
  font-size: 17px;
  line-height: 1.8;
  max-width: 72ch;
}
.blog-body p {
  margin: 0 0 18px;
}
.blog-layout .card:first-child {
  min-height: 720px;
}
#archive {
  align-content: start;
}
.detail-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
}
.detail-modal[hidden] {
  display: none !important;
}
.detail-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 7, 16, 0.72);
  backdrop-filter: blur(6px);
}
.detail-modal-card {
  position: relative;
  z-index: 1;
  width: min(1100px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45), 0 0 40px rgba(51,240,255,0.10);
}
body.modal-open {
  overflow: hidden;
}
.detail-shell {
  display: grid;
  gap: 22px;
}
.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
}
.detail-view h2 {
  margin-bottom: 0;
  max-width: 28ch;
}
.detail-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.detail-close {
  border: 1px solid rgba(51,240,255,0.22);
  background: rgba(51,240,255,0.08);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
}
.detail-close-icon {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 24px;
  line-height: 1;
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.detail-top-grid,
.detail-body-grid {
  margin-bottom: 0;
}
.detail-panel {
  border: 1px solid rgba(132,164,200,0.14);
  border-radius: 20px;
  padding: 20px;
  background: linear-gradient(180deg, rgba(18, 24, 45, 0.78), rgba(13, 18, 35, 0.9));
}
.detail-panel-wide {
  grid-column: 1 / -1;
}
.accent-panel {
  border-color: rgba(255,60,172,0.24);
  box-shadow: 0 0 24px rgba(255,60,172,0.08);
}
.detail-text {
  color: #d6e6f8;
  line-height: 1.8;
  margin: 0;
}
@media (max-width: 920px) {
  .layout, .blog-layout, .detail-grid, .hero, .filter-grid, .dashboard-filter-grid { grid-template-columns: 1fr; }
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    padding: 24px 20px 18px;
  }
  .topbar nav {
    width: 100%;
    justify-content: flex-start;
  }
  .layout, .blog-layout {
    padding: 0 20px 24px;
    gap: 18px;
  }
  .card {
    padding: 18px;
    border-radius: 20px;
  }
  .hero {
    min-height: 0;
    gap: 18px;
  }
  .hero-score strong {
    font-size: 44px;
  }
  .hero-side-compact { min-width: 0; width: 100%; }
  .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .intel-ribbon,
  .section-head,
  .detail-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .dashboard-column {
    min-height: 0;
  }
  .scroll-stack {
    max-height: 420px;
    padding-right: 2px;
  }
  .meta {
    gap: 8px;
    font-size: 13px;
  }
  .blog-cover {
    padding: 18px;
    margin-bottom: 20px;
  }
  .blog-body {
    font-size: 16px;
    line-height: 1.75;
  }
  .blog-layout .card:first-child {
    min-height: 0;
  }
  .detail-modal {
    padding: 10px;
  }
  .detail-modal-card {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
    border-radius: 18px;
    padding: 18px;
  }
  .detail-actions {
    width: 100%;
    justify-content: space-between;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 15px;
  }
  h1 {
    font-size: 32px;
    line-height: 1.1;
  }
  h2 {
    font-size: 26px;
    line-height: 1.15;
  }
  h3 {
    font-size: 20px;
    line-height: 1.2;
  }
  .subtitle {
    font-size: 15px;
  }
  .chips,
  .blog-hero-copy {
    gap: 8px;
  }
  .chip,
  .pill {
    font-size: 12px;
    padding: 5px 10px;
  }
  .metrics-grid {
    grid-template-columns: 1fr;
  }
  .filter-control select,
  .filter-control input,
  .filter-reset {
    min-height: 44px;
  }
  .item {
    padding: 16px;
  }
  .detail-view h2 {
    max-width: none;
  }
}
