/* Criticality Labs — site styles
   Palette: midnight navy, warm ivory, muted gold, scientific teal, graphite.
   Type: IBM Plex Sans (text), IBM Plex Mono (labels, wordmark, small data). */

:root {
  --navy: #0B1F33;
  --graphite: #27313A;
  --ivory: #F5F2E8;
  --gold: #C6A15B;
  --teal: #1F7A8C;

  --ink: #0B1F33;
  --ink-2: #4A555F;
  --ink-3: #8A8272;
  --rule: #DDD7C6;

  --on-navy: #F5F2E8;
  --on-navy-2: #B4C0CB;
  --on-gold: #3D2F12;
  --on-gold-2: #5C4A21;
  --on-graphite: #F5F2E8;
  --on-graphite-2: #A4ADB5;

  --font-sans: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Menlo, Consolas, monospace;

  --max: 1040px;
  --measure: 34em;
  --pad: clamp(20px, 4vw, 40px);
}

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

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

body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* Text links are navy with a gold underline. Menus, buttons and the
   footer set their own look further down. */
a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover { text-decoration-color: currentColor; }

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

.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  background: var(--navy);
  color: var(--on-navy);
  padding: 8px 14px;
  border-radius: 4px;
  z-index: 100;
  text-decoration: none;
}
.skip:focus { left: 8px; }

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--gold);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-top: 12px;
  padding-bottom: 12px;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.16em;
  color: var(--ink);
  white-space: nowrap;
  text-decoration: none;
}
.wordmark .mark { display: block; height: 48px; width: auto; }
.wordmark:hover { text-decoration: none; }
.site-nav { display: flex; gap: 26px; align-items: center; flex-wrap: wrap; }
.site-nav a { color: var(--graphite); font-size: 15px; text-decoration: none; }
.site-nav a:hover { text-decoration: underline; text-underline-offset: 3px; }
.site-nav a[aria-current] { color: var(--ink); border-bottom: 1px solid var(--gold); }

/* Type */
h1, h2, h3 { font-weight: 500; line-height: 1.22; margin: 0; }
h1 { font-size: clamp(32px, 5vw, 46px); letter-spacing: -0.01em; max-width: 12em; }
h2 { font-size: clamp(22px, 3vw, 27px); max-width: 24em; }
h3 { font-size: 18px; }
p { margin: 0; max-width: var(--measure); }
address { font-style: normal; }
p + p { margin-top: 0.9em; }
.lede { font-size: 18px; color: var(--ink-2); }
.muted { color: var(--ink-2); }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 10px;
}
.mono { font-family: var(--font-mono); font-size: 14px; color: var(--ink-3); }

/* Sections */
.section { padding-top: 56px; padding-bottom: 56px; }
.section + .section { border-top: 1px solid var(--rule); }
.section h2 { margin-bottom: 16px; }
.section .more, .band .more { display: inline-block; margin-top: 18px; font-size: 15px; }

.hero { padding-top: clamp(64px, 10vw, 110px); padding-bottom: clamp(56px, 8vw, 96px); }
.hero h1 { margin-bottom: 26px; }
.hero .lede { max-width: 34em; }
.hero .actions { margin-top: 34px; }

.button {
  display: inline-block;
  background: var(--navy);
  color: var(--on-navy);
  font-size: 15px;
  padding: 12px 22px;
  border-radius: 4px;
  border: 1px solid var(--navy);
  text-decoration: none;
}
.button:hover { text-decoration: none; background: #122b45; }
.button.quiet {
  background: transparent;
  color: var(--graphite);
  border-color: var(--gold);
}
.button.quiet:hover { background: rgba(198, 161, 91, 0.12); }

/* Three-column grid of domains */
.domains {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--rule);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  margin-top: 34px;
}
.domains > div {
  background: var(--ivory);
  padding: 28px 24px 30px 0;
}
.domains > div + div { padding-left: 24px; }
.domains h3 { margin-bottom: 10px; }
.domains p { font-size: 15px; color: var(--ink-2); max-width: none; }

/* Colored bands */
.band { padding-top: 56px; padding-bottom: 56px; }
.band h2 { margin-bottom: 16px; }
.band.navy { background: var(--navy); color: var(--on-navy); }
.band.navy p { color: var(--on-navy-2); }
.band.navy .eyebrow { color: var(--gold); }
.band a { text-decoration: none; }
.band a:hover { text-decoration: underline; text-underline-offset: 3px; }
.band.navy a { color: var(--gold); }
.band.navy .status .tag { color: var(--gold); border-color: var(--gold); }
.band.gold { background: var(--gold); color: var(--on-gold); }
.band.gold h2 { color: var(--on-gold); }
.band.gold p { color: var(--on-gold-2); }
.band.gold .eyebrow { color: var(--on-gold-2); }
.band.gold .mono { color: var(--on-gold-2); }
.band.gold a { color: var(--on-gold); text-decoration: underline; text-underline-offset: 3px; }

/* One-line status row */
.status {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 14px 18px;
  padding-top: 28px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--rule);
}
.status .eyebrow { margin: 0; flex: none; }
.status p { color: var(--ink-2); flex: 1 1 260px; }
.tag {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-2);
  border: 1px solid var(--ink-2);
  border-radius: 3px;
  padding: 2px 8px;
  white-space: nowrap;
}

/* Interior pages */
.page-title { padding-top: clamp(48px, 7vw, 80px); padding-bottom: 28px; }
.page-title h1 { margin-bottom: 18px; }
.prose h2 { margin-top: 40px; margin-bottom: 12px; font-size: 22px; }
.prose h2:first-child { margin-top: 0; }
.prose p { color: var(--ink-2); }
.prose ul { padding-left: 1.2em; max-width: var(--measure); }
.prose li { margin-bottom: 0.5em; color: var(--ink-2); }
.prose li strong { color: var(--ink); font-weight: 500; }

.prose address { color: var(--ink-2); max-width: var(--measure); }

/* Footer */
.site-footer {
  background: var(--graphite);
  color: var(--on-graphite);
  margin-top: 0;
}
.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  padding-top: 32px;
  padding-bottom: 36px;
}
.site-footer .name {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.12em;
  margin-bottom: 8px;
}
.site-footer p { color: var(--on-graphite-2); font-size: 14px; max-width: none; }
.site-footer nav { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.site-footer nav a { color: var(--on-graphite-2); font-size: 14px; text-decoration: none; }
.site-footer nav a:hover { color: var(--on-graphite); text-decoration: underline; text-underline-offset: 3px; }
.site-footer .location { font-size: 13px; margin-top: 6px; }
.site-footer .legal { font-size: 13px; margin-top: 10px; }
.site-footer .staff { font-size: 13px; margin-top: 10px; }
.site-footer .staff a { color: var(--on-graphite-2); text-decoration: none; }
.site-footer .staff a:hover { color: var(--on-graphite); text-decoration: underline; text-underline-offset: 3px; }

/* Small layout helpers (kept here so pages carry no inline styles) */
.cta { margin-top: 28px; }
.page-title.not-found { padding-bottom: 72px; }
.cta.cta-wide { margin-top: 34px; }
.status.status-bare { padding: 0 0 18px; border: 0; }
.mono.schedule { margin-top: 14px; line-height: 1.9; }

/* Insights: list of articles */
.dateline {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--ink-2);
}
.article-list { list-style: none; margin: 0; padding: 0; }
.article-list li { padding: 30px 0; border-top: 1px solid var(--rule); }
.article-list li:first-child { padding-top: 0; border-top: 0; }
.article-list li:last-child { padding-bottom: 0; }
.article-list h2 { margin: 6px 0 10px; }
.article-list h2 a { color: var(--ink); text-decoration: none; }
.article-list h2 a:hover { text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 4px; }

/* Insights: a single article */
.article .page-title h1 { max-width: 20em; font-size: clamp(28px, 4.2vw, 40px); }
.article .page-title .eyebrow a { color: inherit; text-decoration: none; }
.article .page-title .eyebrow a:hover { text-decoration: underline; text-underline-offset: 3px; }
.article .page-title .dateline { margin-top: 18px; }

.article-body { --wide: 782px; padding-top: 28px; }
.article-body > * + * { margin-top: 1.1em; }
.article-body h2 { margin-top: 44px; }
.article-body h3 { margin-top: 32px; }
.article-body h2 + *, .article-body h3 + * { margin-top: 0.6em; }
.article-body h2:first-child { margin-top: 0; }
.article-body ol { padding-left: 1.4em; max-width: var(--measure); }
.article-body li { margin-bottom: 0; }
.article-body li + li { margin-top: 0.35em; }
.article-body strong { font-weight: 500; }

.article-body blockquote {
  margin-left: 0;
  margin-right: 0;
  padding-left: 20px;
  border-left: 2px solid var(--gold);
  color: var(--ink-2);
}

.article-body figure { margin: 2em 0; max-width: var(--wide); }
.article-body figure img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: #fff;
}
.article-body figcaption,
.article-body .caption {
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-2);
  max-width: var(--measure);
}

.article-body code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: rgba(11, 31, 51, 0.07);
  padding: 2px 5px;
  border-radius: 3px;
}
.article-body pre {
  margin: 1.6em 0;
  max-width: var(--wide);
  background: var(--navy);
  color: var(--on-navy);
  padding: 20px 22px;
  border-radius: 4px;
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.6;
  tab-size: 4;
}
.article-body pre code { background: none; padding: 0; font-size: inherit; color: inherit; }
.hljs-comment, .hljs-quote { color: var(--on-navy-2); font-style: italic; }
.hljs-keyword, .hljs-literal, .hljs-meta { color: var(--gold); }
.hljs-string, .hljs-regexp { color: #8FD0C4; }
.hljs-number { color: #E8C98F; }
.hljs-title, .hljs-built_in, .hljs-type { color: #9CC7E4; }

.article-body .table-wrap { margin: 1.6em 0; max-width: var(--wide); overflow-x: auto; }
.article-body table { border-collapse: collapse; width: 100%; font-size: 15px; }
.article-body th, .article-body td {
  text-align: left;
  vertical-align: top;
  padding: 9px 18px 9px 0;
  border-bottom: 1px solid var(--rule);
}
.article-body th {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--ink-2);
  border-bottom-color: var(--gold);
}

math { font-family: "STIX Two Math", "Cambria Math", "Latin Modern Math", "Noto Sans Math", math; font-size: 1.08em; }
.article-body .equation { max-width: var(--wide); margin: 1.5em 0; overflow-x: auto; overflow-y: hidden; padding: 2px 0; }
.article-body .equation math, .article-body math[display="block"] { font-size: 1.15em; }
.article-body eqn { display: block; max-width: var(--wide); margin: 1.5em 0; overflow-x: auto; overflow-y: hidden; padding: 2px 0; }

.article-body .footnotes { margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--rule); font-size: 14px; }
.article-body .footnotes li, .article-body .footnotes p { color: var(--ink-2); }
.article-body sup { font-size: 0.72em; line-height: 0; }
.article-body sup a { text-decoration: none; }

.attachments h2 { font-size: 22px; margin-bottom: 12px; }
.attachments ul { list-style: none; margin: 0; padding: 0; max-width: var(--measure); }
.attachments li { padding: 10px 0; border-bottom: 1px solid var(--rule); display: flex; justify-content: space-between; gap: 16px; align-items: baseline; }
.attachments li a { font-family: var(--font-mono); font-size: 14px; overflow-wrap: anywhere; }
.attachments .size { font-family: var(--font-mono); font-size: 12px; color: var(--ink-2); white-space: nowrap; }

.article .article-end { padding-top: 28px; padding-bottom: 56px; font-size: 15px; }
.article .article-end a::before { content: "\2190\00a0"; }

/* Responsive */
/* The header stacks a little earlier than the rest of the layout so the
   menu never wraps beside the logo. */
@media (max-width: 860px) {
  .site-header .wrap { flex-direction: column; align-items: flex-start; gap: 14px; }
  .site-nav { gap: 18px; }
}
@media (max-width: 760px) {
  .domains { grid-template-columns: 1fr; }
  .domains > div { padding: 24px 0; }
  .domains > div + div { padding-left: 0; }
  .site-footer .wrap { flex-direction: column; }
  .site-footer nav { align-items: flex-start; }
}

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