/* Instrumental-Convergence.com — visual identity: serious, technical,
   investigative, calm. Research-institute / intelligence-briefing feel.
   No neon, no doom imagery, no gradients-for-drama. */

:root {
  --ink: #12161c;
  --ink-soft: #3b4351;
  --paper: #fbfaf7;
  --paper-raised: #ffffff;
  --line: #dcd9d0;
  --line-soft: #eae7de;
  --line-strong: #8a8272;  /* meets 3:1 UI-boundary contrast for input/control borders */
  --focus-ring: #1f3d3a;
  --accent: #1f3d3a;       /* deep, muted teal-green — "observatory" not "alarm" */
  --accent-soft: #e7ede9;
  --amber: #8a5a1f;        /* used sparingly for "disputed/unsure" flags */
  --amber-soft: #f3ead9;
  --mono: "IBM Plex Mono", "SF Mono", Consolas, monospace;
  --serif: "IBM Plex Serif", Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --radius: 3px;
  --max-width: 980px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Accessibility helpers ---- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -48px;
  left: 12px;
  z-index: 1000;
  background: var(--ink);
  color: #fff;
  font-family: var(--mono);
  font-size: 0.85rem;
  padding: 10px 16px;
  border-radius: var(--radius);
  transition: none;
}
.skip-link:focus {
  top: 12px;
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

/* Visible, consistent keyboard focus indicator across all interactive elements.
   Mouse/touch users never see this (focus-visible), keyboard users always do. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: var(--radius);
}
.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  outline-offset: 1px;
}

/* Reduced motion: disable non-essential transitions/animations for users who
   have asked for it at the OS level. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* Subtle hover/focus transitions — only applied when the user hasn't asked
   the OS to reduce motion. */
@media (prefers-reduced-motion: no-preference) {
  a, .btn, nav.primary-nav a, .tag, .report-card {
    transition: background-color 0.15s ease, color 0.15s ease,
      border-color 0.15s ease, box-shadow 0.15s ease;
  }
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---- Header / nav ---- */
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--paper-raised);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 18px;
  padding-bottom: 18px;
}
.brand {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.brand .wordmark {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.brand .wordmark span { color: var(--accent); }
.brand .tagline {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 3px;
}
nav.primary-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}
nav.primary-nav a {
  display: inline-flex;
  align-items: center;
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  padding: 8px 14px;
  min-height: 44px;
  border-radius: var(--radius);
}
nav.primary-nav a.primary {
  font-weight: 700;
  color: var(--ink);
}
nav.primary-nav a:hover { background: var(--accent-soft); text-decoration: none; }
nav.primary-nav a.cta {
  background: var(--accent);
  color: #fff;
}
nav.primary-nav a.cta:hover { background: #16302d; }
nav.primary-nav .user-chip {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin-right: 6px;
}

/* ---- Hero ---- */
.hero {
  border-bottom: 1px solid var(--line);
  padding: 64px 0 48px;
  background:
    linear-gradient(180deg, rgba(31,61,58,0.03), rgba(31,61,58,0) 60%);
}
.hero .eyebrow {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}
.hero h1 {
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  letter-spacing: 0.01em;
  margin: 0 0 18px;
  color: var(--ink);
}
.hero p.lede {
  font-family: var(--serif);
  font-size: 1.15rem;
  color: var(--ink-soft);
  max-width: 62ch;
  margin: 0 0 28px;
}
.hero .actions { display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  padding: 11px 20px;
  min-height: 44px;
  border-radius: var(--radius);
  border: 1px solid var(--ink);
  color: var(--ink);
  background: transparent;
  cursor: pointer;
}
.btn:hover { background: var(--ink); color: #fff; text-decoration: none; }
.btn.btn-accent {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn.btn-accent:hover { background: #16302d; }
.btn.btn-small { padding: 6px 12px; font-size: 0.78rem; min-height: 36px; }

/* ---- Stats strip ---- */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--paper-raised);
}
.stats-strip .stat {
  padding: 22px 24px;
  border-right: 1px solid var(--line-soft);
  text-align: center;
}
.stats-strip .stat:last-child { border-right: none; }
.stats-strip .stat .n {
  font-family: var(--mono);
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--accent);
}
.stats-strip .stat .label {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 4px;
}

/* ---- Disclaimer banner ---- */
.disclaimer {
  background: var(--amber-soft);
  border: 1px solid #e3d2ac;
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: 0.92rem;
  color: #4a3413;
  margin: 28px 0;
}
.disclaimer strong { color: #3a2a0f; }

/* ---- Sections ---- */
main { padding: 40px 0 80px; }
section.block { margin-bottom: 52px; }
h2.section-title {
  font-family: var(--mono);
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
  margin-bottom: 20px;
}

/* ---- Report cards ---- */
.report-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-raised);
  padding: 18px 20px;
  margin-bottom: 14px;
}
.report-card h3 {
  margin: 0 0 8px;
  font-size: 1.08rem;
}
.report-card h3 a { color: var(--ink); }
.report-card .meta {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--ink-soft);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 10px;
}
.report-card p.excerpt {
  color: var(--ink-soft);
  font-size: 0.95rem;
  margin: 0;
}

.tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  background: var(--paper);
}
.tag.evidence-firsthand_report { border-color: #b9c9c6; color: var(--accent); background: var(--accent-soft); }
.tag.evidence-documented_research { border-color: #9fb3c8; color: #274a6e; background: #e8eef5; }
.tag.evidence-public_source_observation { border-color: #c8c1a6; color: #6b5b1f; background: #f4f0df; }
.tag.evidence-corroborated_incident { border-color: #9dbfa0; color: #205c2a; background: #e6f3e7; }
.tag.evidence-disputed_interpretation { border-color: #d8b489; color: var(--amber); background: var(--amber-soft); }
.tag.evidence-speculation { border-color: #cbb8d8; color: #5b3a6e; background: #f1e9f5; }

/* ---- Forms ---- */
form.stack { display: flex; flex-direction: column; gap: 20px; max-width: 640px; }
.field label {
  display: block;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
.field .hint { font-size: 0.82rem; color: var(--ink-soft); margin-top: 4px; }
.field input[type="text"],
.field input[type="url"],
.field input[type="date"],
.field textarea,
.field select {
  width: 100%;
  font-family: var(--sans);
  font-size: 1rem; /* 16px: prevents iOS Safari auto-zoom on focus */
  padding: 10px 12px;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--paper-raised);
  color: var(--ink);
}
.field textarea { min-height: 120px; resize: vertical; }
.radio-row, .checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  margin-bottom: 6px;
}
.radio-row label, .checkbox-row label {
  padding: 8px 0;
  cursor: pointer;
}
.radio-row input[type="radio"],
.checkbox-row input[type="checkbox"] {
  width: 20px;
  height: 20px;
  flex: none;
}
.source-row { display: flex; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.source-row select { flex: 0 0 160px; min-width: 0; }
.source-row input { flex: 1 1 160px; min-width: 0; }
.form-error {
  background: #f6e4e0;
  border: 1px solid #dba393;
  color: #7a2c17;
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: 0.92rem;
}
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
legend { font-family: var(--mono); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-soft); padding: 0 6px; }

/* ---- Report detail ---- */
.report-detail .meta-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 18px;
}
.report-detail .body-text {
  font-family: var(--serif);
  font-size: 1.08rem;
  white-space: pre-wrap;
  margin-bottom: 22px;
}
.sources-list { list-style: none; padding: 0; margin: 0; }
.sources-list li {
  font-family: var(--mono);
  font-size: 0.85rem;
  padding: 8px 0;
  border-bottom: 1px solid var(--line-soft);
}
.comment {
  border-left: 2px solid var(--line);
  padding-left: 14px;
  margin: 14px 0;
}
.comment .meta { font-family: var(--mono); font-size: 0.72rem; color: var(--ink-soft); margin-bottom: 4px; }
.comment .children { margin-left: 18px; }

/* ---- Track ---- */
.timeline { border-left: 2px solid var(--line); padding-left: 24px; margin-left: 8px; }
.timeline-item { position: relative; margin-bottom: 30px; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: -29px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
}
.timeline-item .date {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--ink-soft);
}
.timeline-item h3 { margin: 4px 0 6px; }
.bar-chart { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: flex; align-items: center; gap: 10px; }
.bar-row .bar-label { flex: 0 0 220px; font-family: var(--mono); font-size: 0.78rem; color: var(--ink-soft); }
.bar-row .bar-track { flex: 1; background: var(--line-soft); border-radius: 2px; height: 10px; overflow: hidden; }
.bar-row .bar-fill { background: var(--accent); height: 100%; }
.bar-row .bar-count { font-family: var(--mono); font-size: 0.78rem; width: 24px; text-align: right; }

/* ---- Misc ---- */
.prose { max-width: 72ch; }
.prose h2 { margin-top: 2em; }
.prose ul { padding-left: 1.4em; }
.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.category-grid .cat { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; font-size: 0.88rem; background: var(--paper-raised); }

.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 0;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--ink-soft);
}
.site-footer a { color: var(--ink-soft); }
.site-footer .foot-links { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 8px; }

@media (max-width: 720px) {
  .site-header .container { flex-direction: column; align-items: flex-start; gap: 14px; }
  .stats-strip { grid-template-columns: 1fr; }
  .stats-strip .stat { border-right: none; border-bottom: 1px solid var(--line-soft); }

  /* Bigger tap targets once a mouse/trackpad is less likely to be the input. */
  .btn.btn-small { padding: 10px 16px; min-height: 44px; }
  nav.primary-nav a { padding: 10px 14px; }

  /* Fixed-width bar-chart labels overflow narrow (≤375px) viewports; stack instead. */
  .bar-row {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }
  .bar-row .bar-label { flex: none; width: auto; }
  .bar-row .bar-count { width: auto; text-align: left; }

  .hero { padding: 44px 0 36px; }
  .container { padding: 0 16px; }
}
