/*
  OrbiVigil — shared stylesheet
  Design contract: /UIX.md — neutral, restrained, technical, precise.
  No gradients, no glassmorphism, no neon, no oversized marketing headings.
  Light/dark via prefers-color-scheme only. No external fonts or CDN calls.
*/

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body,
h1,
h2,
h3,
h4,
p,
figure,
dl,
dd,
ol,
ul {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

button {
  font: inherit;
}

/* ---------- Tokens (from UIX.md) ---------- */
:root {
  --background: hsl(0 0% 98%);
  --foreground: hsl(222 20% 10%);

  --card: hsl(0 0% 100%);
  --card-foreground: hsl(222 20% 10%);

  --muted: hsl(220 14% 96%);
  --muted-foreground: hsl(220 8% 45%);

  --border: hsl(220 13% 89%);
  --input: hsl(220 13% 89%);

  --primary: hsl(222 47% 11%);
  --primary-foreground: hsl(0 0% 100%);

  --accent: hsl(220 14% 95%);
  --accent-foreground: hsl(222 20% 12%);

  --destructive: hsl(0 72% 51%);
  --destructive-foreground: hsl(0 0% 100%);

  --ring: hsl(221 83% 53%);
  --radius-control: 8px;
  --radius-panel: 12px;

  --font-sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.75rem;
  --text-4xl: 2.125rem;

  --container-width: 1120px;
  --transition-fast: 150ms ease;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: hsl(222 18% 8%);
    --foreground: hsl(210 20% 96%);

    --card: hsl(222 16% 10%);
    --card-foreground: hsl(210 20% 96%);

    --muted: hsl(222 14% 14%);
    --muted-foreground: hsl(215 12% 65%);

    --border: hsl(222 12% 20%);
    --input: hsl(222 12% 20%);

    --primary: hsl(210 20% 96%);
    --primary-foreground: hsl(222 18% 9%);

    --accent: hsl(222 14% 16%);
    --accent-foreground: hsl(210 20% 96%);

    --ring: hsl(217 91% 65%);

    color-scheme: dark;
  }
}

/* ---------- Base ---------- */
body {
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  font-weight: 600;
  line-height: 1.25;
  color: var(--foreground);
}

h1 {
  font-size: var(--text-4xl);
  letter-spacing: -0.01em;
}

h2 {
  font-size: var(--text-2xl);
}

h3 {
  font-size: var(--text-lg);
}

p {
  color: var(--foreground);
}

a {
  text-decoration: none;
}

.wrap {
  max-width: var(--container-width);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

@media (max-width: 640px) {
  .wrap {
    padding-inline: var(--space-4);
  }
  :root {
    --text-4xl: 1.75rem;
    --text-3xl: 1.5rem;
  }
}

/* ---------- Accessibility helpers ---------- */
.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -48px;
  background: var(--primary);
  color: var(--primary-foreground);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-control);
  font-size: var(--text-sm);
  font-weight: 500;
  z-index: 100;
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: var(--space-4);
}

:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Header / nav ---------- */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--card);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding-block: var(--space-3);
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 600;
  font-size: var(--text-base);
  color: var(--foreground);
}

.brand-mark {
  color: var(--ring);
  display: inline-flex;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-6);
}

.site-nav a {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--muted-foreground);
  border-bottom: 1px solid transparent;
  transition: color var(--transition-fast), border-color var(--transition-fast);
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--foreground);
  border-color: var(--ring);
}

.site-nav .nav-cta {
  color: var(--foreground);
  font-weight: 600;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-control);
  font-size: var(--text-sm);
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast),
    color var(--transition-fast);
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-foreground);
  border-color: var(--primary);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: var(--ring);
  border-color: var(--ring);
  color: hsl(0 0% 100%);
}

.btn-secondary {
  background: transparent;
  color: var(--foreground);
  border-color: var(--border);
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
  background: var(--muted);
  border-color: var(--ring);
}

/* ---------- Sections (generic) ---------- */
.section {
  padding-block: var(--space-12);
  border-bottom: 1px solid var(--border);
}

.section:last-of-type {
  border-bottom: none;
}

.section-head {
  max-width: 640px;
  margin-bottom: var(--space-8);
}

.eyebrow {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ring);
  margin-bottom: var(--space-3);
}

.section-head p {
  color: var(--muted-foreground);
  font-size: var(--text-base);
  margin-top: var(--space-3);
}

/* ---------- Hero ---------- */
.hero {
  padding-block: var(--space-12) var(--space-8);
}

.hero-inner {
  max-width: 760px;
}

.hero .tagline {
  font-size: var(--text-lg);
  font-weight: 500;
  color: var(--ring);
  margin-bottom: var(--space-3);
}

.hero h1 {
  margin-bottom: var(--space-4);
}

.hero .lede {
  font-size: var(--text-lg);
  color: var(--muted-foreground);
  max-width: 620px;
  margin-bottom: var(--space-6);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

.notice {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: var(--radius-panel);
  padding: var(--space-4);
  max-width: 640px;
  font-size: var(--text-sm);
  color: var(--muted-foreground);
}

.notice strong {
  color: var(--foreground);
}

.notice-dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ring);
  margin-top: 6px;
}

/* ---------- How it works ---------- */
.step-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-6);
  counter-reset: step;
}

.step-list li {
  position: relative;
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: var(--radius-panel);
  padding: var(--space-6) var(--space-4) var(--space-4);
}

.step-list .step-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--muted);
  color: var(--foreground);
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--space-4);
}

.step-list h3 {
  margin-bottom: var(--space-2);
}

.step-list p {
  color: var(--muted-foreground);
  font-size: var(--text-sm);
}

@media (max-width: 900px) {
  .step-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .step-list {
    grid-template-columns: 1fr;
  }
}

/* ---------- Product grid ---------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
}

.product-card {
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: var(--radius-panel);
  padding: var(--space-6);
  height: 100%;
}

.product-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.product-card h3 {
  font-size: var(--text-base);
}

.product-card p {
  color: var(--muted-foreground);
  font-size: var(--text-sm);
}

.badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--muted-foreground);
  white-space: nowrap;
}

.badge-active {
  color: var(--ring);
  border-color: var(--ring);
}

@media (max-width: 900px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .product-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Data sources ---------- */
.source-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
}

.source-grid li {
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  padding: var(--space-4);
}

.source-grid h3 {
  font-size: var(--text-sm);
  margin-bottom: var(--space-1);
}

.source-grid p {
  font-size: var(--text-xs);
  color: var(--muted-foreground);
}

@media (max-width: 900px) {
  .source-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .source-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Platform / insights ---------- */
.platform-grid,
.insight-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}

.platform-grid article,
.insight-grid article {
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: var(--radius-panel);
  padding: var(--space-6);
}

.platform-grid h3,
.insight-grid h3 {
  margin-bottom: var(--space-2);
}

.platform-grid p,
.insight-grid p {
  color: var(--muted-foreground);
  font-size: var(--text-sm);
  margin-bottom: var(--space-3);
}

.insight-grid a.read-more {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ring);
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition-fast);
}

.insight-grid a.read-more:hover,
.insight-grid a.read-more:focus-visible {
  border-color: var(--ring);
}

@media (max-width: 900px) {
  .platform-grid,
  .insight-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- CTA ---------- */
.cta {
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: var(--radius-panel);
  padding: var(--space-8);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
}

.cta h2 {
  margin-bottom: var(--space-2);
}

.cta p {
  color: var(--muted-foreground);
  max-width: 480px;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding-block: var(--space-8);
  background: var(--card);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-6);
}

.footer-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.footer-nav a {
  font-size: var(--text-sm);
  color: var(--muted-foreground);
  transition: color var(--transition-fast);
}

.footer-nav a:hover,
.footer-nav a:focus-visible {
  color: var(--foreground);
}

.footer-meta {
  font-size: var(--text-xs);
  color: var(--muted-foreground);
  max-width: 520px;
}

.footer-meta p + p {
  margin-top: var(--space-2);
}

/* ---------- Article / SEO page prose ---------- */
.article-header {
  padding-block: var(--space-12) var(--space-6);
  border-bottom: 1px solid var(--border);
}

.article-header .wrap {
  max-width: 760px;
}

.breadcrumb {
  font-size: var(--text-xs);
  color: var(--muted-foreground);
  margin-bottom: var(--space-4);
}

.breadcrumb a {
  color: var(--muted-foreground);
  border-bottom: 1px solid transparent;
}

.breadcrumb a:hover,
.breadcrumb a:focus-visible {
  color: var(--foreground);
  border-color: currentColor;
}

.article-header .dek {
  font-size: var(--text-lg);
  color: var(--muted-foreground);
  margin-top: var(--space-4);
  max-width: 640px;
}

.prose {
  max-width: 720px;
  padding-block: var(--space-8);
}

.prose h2 {
  margin-top: var(--space-8);
  margin-bottom: var(--space-3);
}

.prose h2:first-child {
  margin-top: 0;
}

.prose p {
  margin-bottom: var(--space-4);
  font-size: var(--text-base);
}

.prose ul,
.prose ol {
  margin-bottom: var(--space-4);
  padding-left: var(--space-6);
}

.prose ul {
  list-style: disc;
}

.prose ol {
  list-style: decimal;
}

.prose li {
  margin-bottom: var(--space-2);
}

.prose a {
  color: var(--ring);
  border-bottom: 1px solid var(--border);
  transition: border-color var(--transition-fast);
}

.prose a:hover,
.prose a:focus-visible {
  border-color: var(--ring);
}

.callout {
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: var(--radius-panel);
  padding: var(--space-6);
  margin-block: var(--space-6);
}

.callout h2 {
  margin-top: 0;
}

.related {
  border-top: 1px solid var(--border);
  padding-block: var(--space-8);
}

.related h2 {
  margin-bottom: var(--space-4);
}

.related ul {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
}

.related a {
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  padding: var(--space-4);
  font-size: var(--text-sm);
  font-weight: 600;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.related a:hover,
.related a:focus-visible {
  border-color: var(--ring);
  background: var(--muted);
}

@media (max-width: 900px) {
  .related ul {
    grid-template-columns: 1fr;
  }
}
