/* ── Reset & base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #0d1117;
  --bg-raised:   #161b22;
  --bg-subtle:   #1c2128;
  --border:      #21262d;
  --text:        #e6edf3;
  --text-muted:  #8b949e;
  --text-dim:    #6e7681;
  --accent:      #58a6ff;
  --accent-dim:  #1f6feb;
  --green:       #3fb950;
  --amber:       #d29922;
  --red:         #f85149;
  --purple:      #bc8cff;
  --blue:        #58a6ff;

  /* Beat colors — slightly lighter than mcphail.pro for dark bg */
  --beat-ai-soc:             #3b82f6;
  --beat-pki-pqc:            #a78bfa;
  --beat-talent:             #34d399;
  --beat-enterprise-process: #fbbf24;
  --beat-ecosystem:          #f87171;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", "Cascadia Code", ui-monospace, monospace;
  --max-width: 780px;
}

html { background: var(--bg); color: var(--text); font-family: var(--font-sans); font-size: 16px; line-height: 1.6; }
body { min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; max-width: var(--max-width); width: 100%; margin: 0 auto; padding: 3rem 1.5rem 5rem; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
hr { border: none; border-top: 1px solid var(--border); margin: 1.25rem 0; }
h1 { font-size: 1.6rem; font-weight: 600; line-height: 1.3; color: var(--text); }
h2 { font-size: 1.15rem; font-weight: 600; margin: 2rem 0 0.75rem; color: var(--text); }
h3 { font-size: 1rem; font-weight: 600; margin: 1.5rem 0 0.5rem; }
p { margin-bottom: 1rem; font-size: 0.975rem; line-height: 1.75; }
ul, ol { padding-left: 1.5rem; margin-bottom: 1rem; }
li { font-size: 0.975rem; line-height: 1.75; margin-bottom: 0.25rem; }
code { font-family: var(--font-mono); font-size: 0.85em; background: var(--bg-subtle); padding: 0.1em 0.35em; border-radius: 3px; color: var(--text-muted); }
pre { background: var(--bg-raised); border: 1px solid var(--border); border-radius: 6px; padding: 1rem; overflow-x: auto; margin-bottom: 1.5rem; }
pre code { background: none; padding: 0; font-size: 0.85rem; }

/* ── Navigation ─────────────────────────────────────────────── */
.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--border);
}
.site-name {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
  letter-spacing: -0.02em;
}
.site-name:hover { text-decoration: none; color: var(--accent); }
.nav-links { display: flex; gap: 1.5rem; }
.nav-links a { font-size: 0.875rem; color: var(--text-muted); }
.nav-links a:hover { color: var(--text); text-decoration: none; }

/* ── Footer ─────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem;
  text-align: center;
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
}
.site-footer p { font-size: 0.8rem; color: var(--text-dim); margin: 0; }

/* ── Page header ─────────────────────────────────────────────── */
.page-header { margin-bottom: 2.5rem; }
.page-header h1 { margin: 0.5rem 0 0.25rem; }

.label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
  font-family: var(--font-mono);
}

.intro { font-size: 1rem; color: var(--text-muted); margin-top: 0.75rem; line-height: 1.65; }

/* ── Beat badge (inline-styled in partial; these classes supplement) ── */
.beat-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 3px;
  text-decoration: none;
  font-family: var(--font-mono);
}
.beat-badge:hover { opacity: 0.85; text-decoration: none; }

/* ── Type badges ─────────────────────────────────────────────── */
.type-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 3px;
  margin-left: 0.5rem;
  vertical-align: middle;
  font-family: var(--font-mono);
}
.type-overview  { background: rgba(88, 166, 255, 0.15); color: var(--blue); border: 1px solid rgba(88,166,255,0.3); }
.type-analysis  { background: rgba(188, 140, 255, 0.15); color: var(--purple); border: 1px solid rgba(188,140,255,0.3); }
.type-signal    { background: rgba(248, 81, 73, 0.12); color: var(--red); border: 1px solid rgba(248,81,73,0.25); }

/* ── Insight meta ────────────────────────────────────────────── */
.insight-meta { font-size: 0.8rem; color: var(--text-dim); margin-top: 0.5rem; font-family: var(--font-mono); }

/* ── Insight body (article content) ─────────────────────────── */
.insight-body { }
.insight-body p  { font-size: 0.975rem; line-height: 1.8; color: var(--text); }
.insight-body h2 { font-size: 1.1rem; font-weight: 600; margin: 2.25rem 0 0.75rem; color: var(--text); padding-bottom: 0.4rem; border-bottom: 1px solid var(--border); }
.insight-body h3 { font-size: 1rem; font-weight: 600; margin: 1.75rem 0 0.5rem; }
.insight-body ul, .insight-body ol { margin-bottom: 1rem; }
.insight-body li { font-size: 0.975rem; line-height: 1.75; }
.insight-body strong { font-weight: 600; color: var(--text); }

/* ── Analysis callout ────────────────────────────────────────── */
.analysis-callout {
  margin: 2rem 0;
  padding: 1rem 1.25rem;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent-dim);
  border-radius: 0 6px 6px 0;
}
.analysis-callout a { font-weight: 600; color: var(--accent); font-size: 0.9rem; }

.perspective-panel {
  border-left: 3px solid var(--text-dim);
  background: var(--bg-raised);
  padding: 1rem 1.25rem;
  margin: 1rem 0;
  border-radius: 0 4px 4px 0;
}
.perspective-label {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 0.75rem;
}
.perspective-body {
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.6;
  font-size: 0.975rem;
}
.perspective-body p { margin: 0; }
.perspective-attribution {
  display: block;
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-dim);
  font-style: normal;
}

/* ── Crosslinks (back-navigation) ────────────────────────────── */
.crosslink { font-size: 0.85rem; color: var(--text-dim); margin: 0.5rem 0; }
.crosslink a { color: var(--text-muted); }
.crosslink a:hover { color: var(--text); }

/* ── Insights list (beat landing + landing grid) ─────────────── */
.insights-list { display: flex; flex-direction: column; gap: 0; }
.insight-item {
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
}
.insight-item:last-child { border-bottom: none; }

.insight-link { display: block; text-decoration: none; }
.insight-link:hover .insight-title { color: var(--accent); }
.insight-link:hover { text-decoration: none; }

.insight-date  { font-size: 0.75rem; color: var(--text-dim); font-family: var(--font-mono); margin-bottom: 0.2rem; }
.insight-title { font-size: 1rem; font-weight: 600; color: var(--text); margin-bottom: 0.25rem; }
.insight-desc  { font-size: 0.875rem; color: var(--text-muted); line-height: 1.5; }

/* ── Beat card (on insights landing grid) ────────────────────── */
.beat-card { }
.beat-card .insight-title { font-size: 1.05rem; }
.beat-card .insight-date  { font-size: 0.75rem; color: var(--text-dim); margin-top: 0.3rem; }

/* ── Beat intro (beat landing intro text) ────────────────────── */
.beat-intro { margin-bottom: 2rem; }
.beat-intro p { color: var(--text-muted); font-size: 0.95rem; }

/* ── Analysis link on beat landing ──────────────────────────── */
.analysis-link { margin-top: 0.3rem; }
.analysis-link a { font-size: 0.8rem; color: var(--text-dim); }
.analysis-link a:hover { color: var(--accent); }

/* ── Entity pills ────────────────────────────────────────────── */
.entity-pills { margin: 1.5rem 0; }
.entity-pills .label { margin-bottom: 0.6rem; }
.entity-pill {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 20px;
  margin: 0 4px 6px 0;
  text-decoration: none;
  font-family: var(--font-mono);
  border: 1px solid;
  transition: opacity 0.15s;
}
.entity-pill:hover { opacity: 0.8; text-decoration: none; }

.assessment-positive { background: rgba(63, 185, 80, 0.1); color: var(--green); border-color: rgba(63,185,80,0.35); }
.assessment-caution  { background: rgba(210, 153, 34, 0.1); color: var(--amber); border-color: rgba(210,153,34,0.35); }
.assessment-neutral  { background: rgba(139, 148, 158, 0.1); color: var(--text-muted); border-color: rgba(139,148,158,0.35); }

/* ── Beat entities sidebar ───────────────────────────────────── */
.beat-entities { margin: 2rem 0; }

/* ── Entity cards (entity list/directory) ────────────────────── */
.entity-card .insight-title { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.entity-type-badge {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-family: var(--font-mono);
  background: var(--bg-subtle);
  padding: 1px 6px;
  border-radius: 3px;
}
.assessment-badge {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 3px;
  font-family: var(--font-mono);
}
/* assessment-badge color variants reuse assessment-* above */
.assessment-badge.assessment-positive { background: rgba(63,185,80,0.12); color: var(--green); border: none; }
.assessment-badge.assessment-caution  { background: rgba(210,153,34,0.12); color: var(--amber); border: none; }
.assessment-badge.assessment-neutral  { background: rgba(139,148,158,0.12); color: var(--text-muted); border: none; }

/* ── Entity filter ───────────────────────────────────────────── */
.entity-filter { margin-bottom: 1.5rem; display: flex; align-items: center; gap: 0.75rem; }
.entity-filter label { font-size: 0.8rem; color: var(--text-muted); font-family: var(--font-mono); }
.entity-filter select {
  background: var(--bg-raised);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 0.8rem;
  font-family: var(--font-mono);
  cursor: pointer;
}
.entity-filter select:focus { outline: 1px solid var(--accent); }

/* ── Entity profile meta (dl/dt/dd) ──────────────────────────── */
.entity-meta {
  margin: 1.5rem 0;
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 0.5rem 1rem;
  font-size: 0.875rem;
}
.entity-meta dt { color: var(--text-dim); font-family: var(--font-mono); font-size: 0.8rem; padding-top: 0.1rem; }
.entity-meta dd { color: var(--text); }

/* ── Backlink list ───────────────────────────────────────────── */
.backlink-list { }

/* ── Homepage ────────────────────────────────────────────────── */
.home-hero { margin-bottom: 4rem; }
.home-hero h1 { font-size: 2rem; font-family: var(--font-mono); font-weight: 700; letter-spacing: -0.03em; }
.home-hero .tagline { font-size: 1rem; color: var(--text-muted); margin-top: 0.75rem; max-width: 520px; }
.home-section { margin-bottom: 3rem; }
.home-section h2 { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); font-family: var(--font-mono); border-bottom: 1px solid var(--border); padding-bottom: 0.5rem; margin-bottom: 1rem; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 640px) {
  main { padding: 2rem 1rem 4rem; }
  .site-nav { padding: 1rem; }
  .entity-meta { grid-template-columns: 1fr; }
}
