/* Shared styles for /signals pages. Brand tokens mirror index.html. */
:root {
  --bg: #0E1729;
  --ink: #F4F9FF;
  --ink-body: rgba(244, 249, 255, 0.86);
  --ink-muted: rgba(244, 249, 255, 0.58);
  --rule: rgba(244, 249, 255, 0.12);
  --panel: rgba(244, 249, 255, 0.04);
  --blue: #2B7CD3;
  --blue-light: #7FB2EA;
  --lime: #B4DC3C;
  --magenta: #DC3CB4;
  --copper: #CD7F5F;
  --measure: 680px;
  --wide: 1080px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Open Sans', -apple-system, sans-serif;
  color: var(--ink); background: var(--bg);
  font-weight: 400; -webkit-font-smoothing: antialiased;
  /* Short pages: main grows so the footer sits at the bottom of the viewport. */
  display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh;
}
body > main { flex: 1 0 auto; }
img { display: block; max-width: 100%; height: auto; }
::selection { background: rgba(43, 124, 211, 0.45); }

/* ---------- Site chrome (matches homepage nav + footer) ---------- */
.site-nav {
  display: flex; justify-content: space-between; align-items: center;
  padding: 32px 44px; position: relative; z-index: 2;
}
.brand { display: inline-flex; align-items: center; opacity: 0.95; }
.brand img { height: 32px; width: auto; }
.nav-links { display: inline-flex; align-items: center; gap: 10px; }
.nav-links a {
  font-size: 14px; font-weight: 500; letter-spacing: 0.02em;
  color: var(--ink); text-decoration: none; opacity: 0.7;
  transition: opacity 0.3s; padding: 4px 6px;
}
.nav-links a:hover, .nav-links a[aria-current] { opacity: 1; }
.nav-links .sep { opacity: 0.35; font-weight: 400; font-size: 14px; }
.nav-links .x-icon { display: inline-block; width: 13px; height: 13px; vertical-align: middle; }

.site-foot {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 48px;
  padding: 32px 44px; margin-top: 96px;
  font-size: 14px; line-height: 1.45;
}
.site-foot .tagline { opacity: 0.85; }
.site-foot a { color: var(--ink); text-decoration: none; opacity: 0.85; transition: opacity 0.3s; }
.site-foot a:hover { opacity: 1; }
.site-foot .foot-links { display: inline-flex; gap: 20px; }

/* ---------- Plain text pages (privacy, terms) ---------- */
.page { max-width: var(--measure); margin: 0 auto; padding: 56px 24px 0; font-size: 17px; line-height: 1.7; color: var(--ink-body); }
.page h1 { font-size: clamp(32px, 4.5vw, 44px); font-weight: 600; letter-spacing: -0.02em; color: var(--ink); line-height: 1.1; }
.page .updated { margin-top: 10px; font-size: 14px; color: var(--ink-muted); }
.page p { margin-top: 1.1em; }
.page a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--blue); text-underline-offset: 3px; }
.page h2 { margin-top: 2.2em; font-size: 22px; line-height: 1.3; font-weight: 600; letter-spacing: -0.01em; color: var(--ink); scroll-margin-top: 24px; }
.page h2 + * { margin-top: 0.6em; }
.page strong { font-weight: 600; color: var(--ink); }
.page ul { margin-top: 1.1em; padding-left: 1.2em; }
.page li + li { margin-top: 0.5em; }
.page .callout { margin-top: 1.1em; }

/* Dot-matrix texture: a still echo of the homepage canvas (18px grid). */
.dots {
  background-image: radial-gradient(circle, rgba(244, 249, 255, 0.16) 1.2px, transparent 1.6px);
  background-size: 18px 18px;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 0%, transparent 100%);
}

/* Four brand accents as a small "signal" mark. */
.signal-mark { display: inline-flex; gap: 4px; vertical-align: middle; margin-right: 10px; }
.signal-mark i { width: 6px; height: 6px; border-radius: 50%; display: block; }
.signal-mark i:nth-child(1) { background: var(--copper); }
.signal-mark i:nth-child(2) { background: var(--magenta); }
.signal-mark i:nth-child(3) { background: var(--lime); }
.signal-mark i:nth-child(4) { background: var(--blue); }

/* ---------- Post header ---------- */
.post-head-wrap { position: relative; }
.post-head-wrap .dots { position: absolute; inset: -120px 0 0 0; z-index: 0; pointer-events: none; }
.post-head {
  position: relative; z-index: 1;
  max-width: var(--wide); margin: 0 auto; padding: 56px 44px 40px;
}
.kicker {
  font-size: 13px; font-weight: 500; letter-spacing: 0.04em; color: var(--ink-muted);
  display: flex; align-items: center; flex-wrap: wrap; gap: 0 8px;
}
.kicker a { color: var(--ink); text-decoration: none; opacity: 0.85; }
.kicker a:hover { opacity: 1; }
.post-head h1 {
  font-size: clamp(34px, 5.2vw, 58px); line-height: 1.08; font-weight: 600;
  letter-spacing: -0.02em; margin: 22px 0 16px; max-width: 16ch;
}
.dek { font-size: clamp(18px, 2vw, 21px); line-height: 1.5; color: var(--ink-body); max-width: 40ch; }
.byline { margin-top: 26px; font-size: 14px; color: var(--ink-muted); }
.byline a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--rule); }
.byline a:hover { border-bottom-color: var(--ink); }

.hero { max-width: var(--wide); margin: 0 auto; padding: 0 44px; }
.hero img { width: 100%; border-radius: 12px; border: 1px solid var(--rule); background: #fff; }
.hero figcaption { max-width: var(--measure); margin: 14px auto 0; }

/* ---------- Prose ---------- */
.prose {
  max-width: var(--measure); margin: 0 auto; padding: 56px 24px 0;
  font-size: 18px; line-height: 1.75; color: var(--ink-body);
}
.prose > * + * { margin-top: 1.15em; }
.prose h2 {
  font-size: 26px; line-height: 1.25; font-weight: 600; color: var(--ink);
  letter-spacing: -0.01em; margin-top: 2.4em;
}
.prose h2 + * { margin-top: 0.7em; }
.prose strong { font-weight: 600; color: var(--ink); }
.prose em { font-style: italic; }
.prose a {
  color: var(--ink); text-decoration: underline; text-decoration-color: var(--blue);
  text-decoration-thickness: 1.5px; text-underline-offset: 3px; transition: text-decoration-color 0.2s;
}
.prose a:hover { text-decoration-color: var(--blue-light); }

.prose ol { list-style: none; counter-reset: step; padding: 0; }
.prose ol > li { counter-increment: step; position: relative; padding-left: 44px; }
.prose ol > li + li { margin-top: 0.8em; }
.prose ol > li::before {
  content: counter(step); position: absolute; left: 0; top: 0.18em;
  width: 28px; height: 28px; border-radius: 50%;
  border: 1px solid rgba(43, 124, 211, 0.6); color: var(--blue-light);
  font-size: 13px; font-weight: 600; line-height: 26px; text-align: center;
  font-variant-numeric: tabular-nums;
}

.callout {
  border-left: 2px solid var(--blue); padding: 4px 0 4px 20px; color: var(--ink);
}

.table-wrap { overflow-x: auto; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.5; }
.prose th {
  text-align: left; font-weight: 600; color: var(--ink-muted); font-size: 12px;
  letter-spacing: 0.06em; text-transform: uppercase; padding: 0 16px 10px 0;
  border-bottom: 1px solid var(--rule);
}
.prose td { padding: 12px 16px 12px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.prose td:first-child { color: var(--ink); font-weight: 500; white-space: nowrap; }

/* Figures: light charts and screenshots sit on the dark page as cards. */
.prose figure { margin-top: 2em; margin-bottom: 2em; }
figure .zoom { display: block; cursor: zoom-in; }
.prose figure img { width: 100%; border-radius: 10px; border: 1px solid var(--rule); background: #fff; }
.prose figure.bleed { margin-left: -40px; margin-right: -40px; }
figcaption { font-size: 14px; line-height: 1.55; color: var(--ink-muted); margin-top: 12px; }

/* ---------- Post footer ---------- */
.post-foot { max-width: var(--measure); margin: 72px auto 0; padding: 0 24px; }
.cta {
  border: 1px solid var(--rule); border-radius: 12px; background: var(--panel);
  padding: 28px; font-size: 16px; line-height: 1.6; color: var(--ink-body);
}
.cta p + p { margin-top: 6px; }
.cta strong { color: var(--ink); font-weight: 600; }
.cta a:not(.btn) { color: var(--ink); text-decoration: underline; text-decoration-color: rgba(244, 249, 255, 0.3); text-underline-offset: 3px; }
.cta a:not(.btn):hover { text-decoration-color: var(--ink); }
.cta-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px;
  font-size: 14px; font-weight: 500; letter-spacing: 0.02em; text-decoration: none;
  color: var(--ink); border: 1px solid rgba(244, 249, 255, 0.28); transition: background 0.2s, border-color 0.2s;
}
.btn:hover { background: rgba(244, 249, 255, 0.08); border-color: rgba(244, 249, 255, 0.5); }
.btn.primary { background: var(--blue); border-color: var(--blue); }
.btn.primary:hover { background: #3a8ae0; border-color: #3a8ae0; }

/* ---------- Signals index ---------- */
.index-head { max-width: var(--wide); margin: 0 auto; padding: 56px 44px 8px; position: relative; z-index: 1; }
.index-head h1 { font-size: clamp(34px, 5vw, 52px); font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; }
.index-head p { margin-top: 14px; font-size: 18px; line-height: 1.55; color: var(--ink-body); max-width: 46ch; }
.posts { max-width: var(--wide); margin: 0 auto; padding: 40px 44px 0; display: grid; gap: 28px; }
.post-card {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 32px; align-items: center;
  text-decoration: none; color: inherit; border: 1px solid var(--rule); border-radius: 14px;
  padding: 16px; background: var(--panel); transition: border-color 0.25s, background 0.25s;
}
.post-card:hover { border-color: rgba(244, 249, 255, 0.3); background: rgba(244, 249, 255, 0.06); }
.post-card img { width: 100%; border-radius: 9px; background: #fff; }
.post-card .meta { font-size: 13px; letter-spacing: 0.04em; color: var(--ink-muted); }
.post-card h2 { font-size: clamp(24px, 2.6vw, 32px); line-height: 1.15; font-weight: 600; letter-spacing: -0.015em; margin: 12px 0 10px; }
.post-card p { font-size: 16px; line-height: 1.6; color: var(--ink-body); }
.post-card .more { display: inline-block; margin-top: 16px; font-size: 14px; font-weight: 500; color: var(--blue-light); }

/* ---------- Lightbox ---------- */
dialog.lightbox {
  border: 0; padding: 0; background: transparent; max-width: 96vw; max-height: 94vh;
  margin: auto; cursor: zoom-out;
}
dialog.lightbox::backdrop { background: rgba(6, 10, 20, 0.88); }
dialog.lightbox img { max-width: 96vw; max-height: 94vh; width: auto; height: auto; border-radius: 8px; background: #fff; }

@media (max-width: 720px) {
  .site-nav { padding: 22px 22px; }
  .brand img { height: 26px; }
  .post-head, .index-head { padding: 36px 22px 28px; }
  .hero { padding: 0; }
  .hero img { border-radius: 0; border-left: 0; border-right: 0; }
  .hero figcaption { padding: 0 22px; }
  .prose { padding: 40px 22px 0; font-size: 17px; line-height: 1.7; }
  .prose h2 { font-size: 23px; }
  .prose figure.bleed { margin-left: -22px; margin-right: -22px; }
  .prose figure.bleed img { border-radius: 0; border-left: 0; border-right: 0; }
  .prose figure.bleed figcaption { padding: 0 22px; }
  .prose ol > li { padding-left: 40px; }
  .post-foot { padding: 0 22px; }
  .posts { padding: 28px 22px 0; }
  .post-card { grid-template-columns: 1fr; gap: 18px; padding: 12px 12px 20px; }
  .post-card > div { padding: 0 6px; }
  .site-foot { flex-direction: column; align-items: flex-start; gap: 14px; padding: 28px 22px; margin-top: 72px; }
}

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