/* Stackwire — editorial type scale, one brand accent, category hues used sparingly.
   Light by default, dark via prefers-color-scheme. All colour goes through tokens so
   the two themes stay in sync. */

:root {
  --paper:      #fbfaf8;
  --surface:    #ffffff;
  --ink:        #14161a;
  --ink-2:      #3d434e;
  --muted:      #6b7280;
  --rule:       #e4e1db;
  --rule-soft:  #efedE8;
  --accent:     #c93c17;
  --accent-ink: #ffffff;
  --code-bg:    #f4f2ee;

  --hue-infrastructure: #5b53c9;
  --hue-ai-models:      #b0431f;
  --hue-security:       #b02121;
  --hue-space-robotics: #10707d;
  --hue-devices:        #2f7a43;

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Helvetica, Arial, sans-serif;
  --serif: Charter, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --measure: 34rem;
  --wide: 72rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:      #0d0f12;
    --surface:    #14171c;
    --ink:        #e9e7e2;
    --ink-2:      #c2c5cc;
    --muted:      #929aa6;
    --rule:       #272c34;
    --rule-soft:  #1d222a;
    --accent:     #ff7043;
    --accent-ink: #1a0d07;
    --code-bg:    #1a1f26;

    --hue-infrastructure: #9a92ff;
    --hue-ai-models:      #ff8a5c;
    --hue-security:       #ff6b6b;
    --hue-space-robotics: #34c3d1;
    --hue-devices:        #5cc47a;
  }
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration-color: color-mix(in srgb, var(--accent) 55%, transparent); text-underline-offset: 2px; }
a:hover { color: var(--accent); }

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

.wrap { width: 100%; max-width: var(--wide); margin: 0 auto; padding: 0 1.5rem; }

/* ---------- eyebrow / labels ---------- */
.eyebrow {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}

.cat {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--cat, var(--accent));
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  font-weight: 600;
}
.cat::before {
  content: "";
  width: 0.5em; height: 0.5em;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}
.cat:hover { color: var(--cat, var(--accent)); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- masthead ---------- */
.masthead {
  border-bottom: 1px solid var(--rule);
  background: var(--surface);
  position: sticky; top: 0; z-index: 20;
}
.masthead-in {
  display: flex; align-items: center; gap: 1.5rem;
  min-height: 4rem;
  flex-wrap: wrap;
}
.wordmark {
  font-family: var(--sans);
  font-weight: 800;
  font-size: 1.1875rem;
  letter-spacing: -0.028em;
  text-decoration: none;
  color: var(--ink);
  display: inline-flex; align-items: baseline; gap: 0.5rem;
  margin-right: auto;
}
.wordmark:hover { color: var(--ink); }
.wordmark .tick {
  width: 0.5rem; height: 0.5rem;
  background: var(--accent);
  display: inline-block;
  align-self: center;
}
.wordmark .sub {
  font-family: var(--mono);
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.nav { display: flex; gap: 1.125rem; flex-wrap: wrap; align-items: center; }
.nav a {
  font-family: var(--sans);
  font-size: 0.8125rem;
  font-weight: 550;
  letter-spacing: -0.005em;
  text-decoration: none;
  color: var(--ink-2);
}
.nav a:hover, .nav a[aria-current] { color: var(--accent); }

/* ---------- hero / lead ---------- */
.lead { padding: 3.25rem 0 2.5rem; border-bottom: 1px solid var(--rule); }
.lead-grid { display: grid; gap: 2.25rem; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 62rem) { .lead-grid { grid-template-columns: 1.35fr 1fr; gap: 3rem; } }

.lead h1 {
  font-family: var(--sans);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.05;
  font-size: clamp(2rem, 5.2vw, 3.25rem);
  margin: 0.75rem 0 0.875rem;
  text-wrap: balance;
}
.lead h1 a { text-decoration: none; }
.lead .standfirst {
  font-size: 1.1875rem;
  line-height: 1.55;
  color: var(--ink-2);
  margin: 0 0 1.25rem;
  max-width: 36rem;
}
.lead-cover { border: 1px solid var(--rule); border-radius: 2px; overflow: hidden; }

/* ---------- meta line ---------- */
.meta {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex; flex-wrap: wrap; gap: 0.5rem 0.875rem;
  align-items: center;
  margin: 0;
}
.meta .sep { opacity: 0.4; }

/* ---------- card grid ---------- */
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; padding: 2.5rem 0 1.25rem;
  border-bottom: 1px solid var(--rule);
}
.section-head h2 {
  font-family: var(--sans); font-weight: 750; letter-spacing: -0.02em;
  font-size: 1.0625rem; margin: 0;
}

.cards {
  display: grid; gap: 0;
  grid-template-columns: 1fr;
}
@media (min-width: 44rem) { .cards { grid-template-columns: 1fr 1fr; column-gap: 2.5rem; } }
@media (min-width: 68rem) { .cards { grid-template-columns: repeat(3, 1fr); } }

.card {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--rule-soft);
  display: flex; flex-direction: column; gap: 0.625rem;
}
.card-cover { border: 1px solid var(--rule); border-radius: 2px; overflow: hidden; margin-bottom: 0.25rem; }
.card h3 {
  font-family: var(--sans);
  font-weight: 700; letter-spacing: -0.022em; line-height: 1.2;
  font-size: 1.125rem; margin: 0;
  text-wrap: pretty;
}
.card h3 a { text-decoration: none; }
.card h3 a:hover { text-decoration: underline; text-underline-offset: 2px; }
.card p { margin: 0; color: var(--ink-2); font-size: 0.9375rem; line-height: 1.55; }

/* ---------- article ---------- */
.article-head { padding: 3rem 0 0; border-bottom: 1px solid var(--rule); }
.article-head .inner { max-width: 44rem; }
.article-head h1 {
  font-family: var(--sans);
  font-weight: 800; letter-spacing: -0.035em; line-height: 1.06;
  font-size: clamp(1.875rem, 4.6vw, 2.875rem);
  margin: 0.75rem 0 1rem;
  text-wrap: balance;
}
.article-head .standfirst {
  font-size: 1.1875rem; line-height: 1.55; color: var(--ink-2);
  margin: 0 0 1.5rem; max-width: 36rem;
}
.article-cover { margin: 1.75rem 0 0; border-top: 1px solid var(--rule); }

.prose { max-width: var(--measure); margin: 0; padding: 2.5rem 0 1rem; }
.prose > * { margin: 0 0 1.375rem; }
.prose > :last-child { margin-bottom: 0; }

.prose p { font-size: 1.0625rem; line-height: 1.68; }
.prose h2 {
  font-family: var(--sans); font-weight: 750; letter-spacing: -0.024em;
  font-size: 1.375rem; line-height: 1.25;
  margin: 2.75rem 0 1rem; padding-top: 0.25rem;
  text-wrap: balance;
}
.prose h3 {
  font-family: var(--sans); font-weight: 700; letter-spacing: -0.018em;
  font-size: 1.0625rem; line-height: 1.35;
  margin: 2rem 0 0.625rem;
  color: var(--ink);
}
.prose ul, .prose ol { padding-left: 1.25rem; }
.prose li { margin-bottom: 0.625rem; line-height: 1.6; }
.prose li::marker { color: var(--accent); }

.prose strong { font-weight: 700; color: var(--ink); }

.prose blockquote {
  margin: 2rem 0; padding: 0 0 0 1.25rem;
  border-left: 2px solid var(--accent);
}
.prose blockquote p {
  font-family: var(--sans);
  font-size: 1.1875rem; font-weight: 500; letter-spacing: -0.018em;
  line-height: 1.4; color: var(--ink); margin: 0;
  text-wrap: pretty;
}
.prose blockquote cite {
  display: block; margin-top: 0.625rem;
  font-family: var(--mono); font-style: normal;
  font-size: 0.6875rem; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--muted);
}

.prose hr {
  border: 0; border-top: 1px solid var(--rule); margin: 2.5rem 0;
}

/* Tables break out of the text measure — three columns of prose in 34rem is unreadable.
   .prose is left-aligned inside a much wider .wrap and sets no overflow, so a wider
   child simply extends to the right. The viewport term keeps it inside the page gutter
   on narrow screens. */
.prose figure.wp-block-table {
  margin: 2rem 0;
  width: min(52rem, calc(100vw - 3rem));
  max-width: none;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.prose table {
  width: 100%; border-collapse: collapse;
  font-family: var(--sans); font-size: 0.875rem; line-height: 1.45;
}
.prose thead th {
  text-align: left; padding: 0.625rem 0.875rem 0.625rem 0;
  border-bottom: 1.5px solid var(--ink);
  font-weight: 700; letter-spacing: -0.005em;
  white-space: nowrap;
}
.prose tbody td {
  padding: 0.75rem 0.875rem 0.75rem 0;
  border-bottom: 1px solid var(--rule-soft);
  vertical-align: top; color: var(--ink-2);
}
.prose tbody tr td:first-child { color: var(--ink); font-weight: 550; }

.prose code {
  font-family: var(--mono); font-size: 0.875em;
  background: var(--code-bg); padding: 0.15em 0.35em; border-radius: 2px;
}

/* ---------- article footer ---------- */
.tags { display: flex; flex-wrap: wrap; gap: 0.4375rem; margin: 0; padding: 0; list-style: none; }
.tags a {
  font-family: var(--mono); font-size: 0.6875rem; letter-spacing: 0.03em;
  text-decoration: none; color: var(--muted);
  border: 1px solid var(--rule); border-radius: 999px;
  padding: 0.1875rem 0.5625rem;
  display: inline-block;
}
.tags a:hover { color: var(--accent); border-color: var(--accent); }

.article-foot { border-top: 1px solid var(--rule); margin-top: 3rem; padding: 1.75rem 0 0; max-width: 44rem; }

/* ---------- footer ---------- */
.site-foot {
  border-top: 1px solid var(--rule);
  margin-top: 4rem; padding: 2.5rem 0 3.5rem;
  background: var(--surface);
}
.foot-grid { display: grid; gap: 2rem; grid-template-columns: 1fr; }
@media (min-width: 48rem) { .foot-grid { grid-template-columns: 1.5fr 1fr 1fr; gap: 3rem; } }
.site-foot h4 {
  font-family: var(--mono); font-size: 0.6875rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted); font-weight: 500;
  margin: 0 0 0.875rem;
}
.site-foot ul { list-style: none; margin: 0; padding: 0; }
.site-foot li { margin-bottom: 0.5rem; }
.site-foot a { font-family: var(--sans); font-size: 0.875rem; text-decoration: none; color: var(--ink-2); }
.site-foot a:hover { color: var(--accent); }
.site-foot .colophon {
  font-family: var(--sans); font-size: 0.8125rem; line-height: 1.6;
  color: var(--muted); margin: 0.75rem 0 0; max-width: 26rem;
}
.built {
  border-top: 1px solid var(--rule-soft); margin-top: 2.25rem; padding-top: 1.25rem;
  font-family: var(--mono); font-size: 0.6875rem; letter-spacing: 0.04em;
  color: var(--muted);
  display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; justify-content: space-between;
}

/* ---------- misc pages ---------- */
.page-head { padding: 3.25rem 0 1.75rem; border-bottom: 1px solid var(--rule); }
.page-head h1 {
  font-family: var(--sans); font-weight: 800; letter-spacing: -0.032em; line-height: 1.08;
  font-size: clamp(1.875rem, 4.4vw, 2.625rem); margin: 0.625rem 0 0.75rem;
}
.page-head p { color: var(--ink-2); margin: 0; max-width: 34rem; font-size: 1.0625rem; }

.center-note { padding: 6rem 0; text-align: center; max-width: 30rem; margin: 0 auto; }

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

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: var(--accent-ink);
  padding: 0.625rem 1rem; z-index: 100;
  font-family: var(--sans); font-size: 0.875rem; text-decoration: none;
}
.skip:focus { left: 0; color: var(--accent-ink); }

@media print {
  .masthead, .site-foot, .article-cover, .card-cover { display: none; }
  body { background: #fff; color: #000; }
}
