/* OIA Shield24 blog — hand-written, zero build step, zero render-blocking JS.
   Same brand tokens + `html.dark` theme convention as /landing.html. */

:root {
  --brand: #b85b48;
  --brand-hover: #9a4c3c;
  --brand-light: #d27c6a;
  --bg: #fafafa;
  --surface: #ffffff;
  --surface-2: #f4f4f5;
  --border: #e4e4e7;
  --text: #18181b;
  --text-muted: #52525b;
  --text-faint: #71717a;
  --link: #9a4c3c;
  --code-bg: #f4f4f5;
  --pre-bg: #18181b;
  --pre-text: #f4f4f5;
  --header-bg: rgba(255, 255, 255, 0.85);
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Outfit', 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', Consolas, monospace;
  --header-h: 4.5rem;
  color-scheme: light;
}

html.dark {
  --bg: #09090b;
  --surface: #18181b;
  --surface-2: #27272a;
  --border: #3f3f46;
  --text: #fafafa;
  --text-muted: #a1a1aa;
  --text-faint: #8a8a93;
  --link: #e29383;
  --code-bg: #27272a;
  --pre-bg: #111114;
  --pre-text: #f4f4f5;
  --header-bg: rgba(24, 24, 27, 0.85);
  --shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; height: auto; }
h1, h2, h3, h4 { overflow-wrap: anywhere; } /* long identifiers such as QUERY_LIMIT_EXCEEDED must not widen the page */
a { color: var(--link); text-underline-offset: 3px; }
a:hover { color: var(--brand); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 4px; }

.skip-link {
  position: absolute; left: -999px; top: 0.5rem; z-index: 100;
  background: var(--brand); color: #fff; padding: 0.5rem 1rem; border-radius: 0.5rem;
}
.skip-link:focus { left: 0.5rem; }

.container { width: 100%; max-width: 76rem; margin: 0 auto; padding: 0 1.25rem; }

/* ---------------------------------------------------------------- header */
.site-header-wrap { position: sticky; top: 0.75rem; z-index: 50; padding: 0 1rem; }
.site-header {
  max-width: 76rem; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
  padding: 0.55rem 0.75rem 0.55rem 1.25rem;
  background: var(--header-bg); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border); border-radius: 999px; box-shadow: var(--shadow);
}
.brand { display: inline-flex; align-items: center; gap: 0.75rem; text-decoration: none; color: var(--text); white-space: nowrap; flex-shrink: 0; }
.brand img { height: 2rem; width: auto; display: block; }
.brand-name {
  font-family: var(--font-display); font-weight: 700; font-size: 1rem; letter-spacing: -0.01em;
  padding-left: 0.75rem; border-left: 1px solid var(--border);
}
.logo-for-light { display: none !important; }
html:not(.dark) .logo-for-light { display: block !important; }
html:not(.dark) .logo-for-dark { display: none !important; }

.primary-nav { display: none; flex: 1; justify-content: center; gap: 0.25rem; }
.primary-nav a {
  padding: 0.45rem 0.9rem; border-radius: 999px; white-space: nowrap;
  font-size: 0.8125rem; font-weight: 500; color: var(--text-muted); text-decoration: none;
  transition: color 0.2s, background-color 0.2s;
}
.primary-nav a:hover { color: var(--text); background: var(--surface-2); }
.primary-nav a[aria-current='page'] { color: var(--text); background: var(--surface-2); }

.header-actions { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.25rem; height: 2.25rem; border-radius: 999px; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-muted);
}
.icon-btn:hover { color: var(--text); }
.icon-btn svg { width: 1rem; height: 1rem; }
#theme-sun { display: none; }
html.dark #theme-sun { display: block; }
html.dark #theme-moon { display: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.55rem 1.1rem; border-radius: 999px; border: 1px solid transparent;
  font: 700 0.8125rem/1.2 var(--font-sans); white-space: nowrap; text-decoration: none; cursor: pointer;
  transition: background-color 0.2s, color 0.2s, transform 0.2s;
}
.btn-primary { background: var(--text); color: var(--bg); }
.btn-primary:hover { background: var(--text-muted); color: var(--bg); }
.btn-brand { background: var(--brand); color: #fff; }
.btn-brand:hover { background: var(--brand-hover); color: #fff; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-lg { padding: 0.85rem 1.6rem; font-size: 0.95rem; }
.hide-sm { display: none; }
.hide-md { display: none; }

.menu-toggle { display: inline-flex; }
.mobile-menu {
  max-width: 76rem; margin: 0.5rem auto 0; padding: 0.75rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: 1.25rem; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 0.15rem;
}
.mobile-menu[hidden] { display: none; }
.mobile-menu a {
  padding: 0.7rem 1rem; border-radius: 0.75rem; font-weight: 500; font-size: 0.95rem;
  color: var(--text); text-decoration: none;
}
.mobile-menu a:hover, .mobile-menu a[aria-current='page'] { background: var(--surface-2); }
.mobile-menu hr { width: 100%; border: 0; border-top: 1px solid var(--border); margin: 0.4rem 0; }

@media (min-width: 640px) { .hide-sm { display: inline-flex; } }
@media (min-width: 1024px) {
  .primary-nav { display: flex; }
  .menu-toggle { display: none; }
  .mobile-menu { display: none !important; }
}
@media (min-width: 1180px) { .hide-md { display: inline-flex; } }

/* ------------------------------------------------------------------ main */
main { flex: 1; }
.eyebrow {
  display: inline-block; padding: 0.3rem 0.85rem; border-radius: 999px;
  background: color-mix(in srgb, var(--brand) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--brand) 28%, transparent);
  color: var(--link); font: 500 0.7rem/1.2 var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase;
}

/* --------------------------------------------------------------- catalog */
.catalog-hero { text-align: center; padding: 4.5rem 0 2.5rem; }
.catalog-hero h1 {
  font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em;
  font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1.1; margin: 1rem 0 0.9rem;
}
.catalog-hero p { max-width: 42rem; margin: 0 auto; color: var(--text-muted); font-size: 1.1rem; }

.card-grid { display: grid; gap: 1.5rem; grid-template-columns: 1fr; padding-bottom: 2rem; }
@media (min-width: 720px) { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .card-grid.cols-3 { grid-template-columns: repeat(3, 1fr); } }

.post-card {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: 1.25rem;
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.post-card:hover { transform: translateY(-4px); border-color: var(--brand); box-shadow: var(--shadow); }
.post-card .thumb { display: block; aspect-ratio: 1200 / 630; background: #0f0f12; }
.post-card .thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.post-card .body { display: flex; flex-direction: column; gap: 0.6rem; padding: 1.25rem 1.4rem 1.5rem; flex: 1; }
.post-card h2, .post-card h3 { font-family: var(--font-display); font-size: 1.2rem; line-height: 1.3; margin: 0; letter-spacing: -0.01em; }
.post-card h2 a, .post-card h3 a { color: var(--text); text-decoration: none; }
.post-card h2 a::after, .post-card h3 a::after { content: ''; position: absolute; inset: 0; }
.post-card { position: relative; }
.post-card p { margin: 0; color: var(--text-muted); font-size: 0.9rem; line-height: 1.6; }
.post-card .more { margin-top: auto; padding-top: 0.5rem; font-size: 0.85rem; font-weight: 600; color: var(--link); }

.post-card.featured { grid-column: 1 / -1; }
@media (min-width: 900px) {
  .post-card.featured { flex-direction: row; }
  /* Never crop a diagram: letterbox it on its own dark background instead. */
  .post-card.featured .thumb { flex: 1.25; aspect-ratio: auto; display: flex; align-items: center; }
  .post-card.featured .thumb img { height: auto; object-fit: contain; }
  .post-card.featured .body { flex: 1; justify-content: center; padding: 2rem 2.25rem; }
  .post-card.featured h2 { font-size: 1.8rem; }
  .post-card.featured p { font-size: 1rem; }
}

.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.9rem; font-size: 0.8rem; color: var(--text-faint); }
.meta .tag { color: var(--link); font: 500 0.7rem/1 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; }

.agent-note {
  margin: 1rem auto 4rem; padding: 1.4rem 1.6rem; max-width: 60rem;
  background: var(--surface); border: 1px dashed var(--border); border-radius: 1.25rem;
}
.agent-note h2 { font: 700 1.05rem/1.3 var(--font-display); margin: 0 0 0.5rem; }
.agent-note p { margin: 0 0 0.6rem; color: var(--text-muted); font-size: 0.92rem; }
.agent-note ul { margin: 0; padding-left: 1.1rem; color: var(--text-muted); font-size: 0.9rem; }
.agent-note code { font-size: 0.82em; }

/* --------------------------------------------------------------- article */
.breadcrumbs { padding: 2rem 0 0; font-size: 0.82rem; color: var(--text-faint); }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0; padding: 0; }
.breadcrumbs li + li::before { content: '/'; margin-right: 0.4rem; color: var(--border); }
.breadcrumbs a { color: var(--text-muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--brand); text-decoration: underline; }

.article-head { max-width: 52rem; padding: 1.25rem 0 1.75rem; }
.article-head h1 {
  font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em;
  font-size: clamp(1.75rem, 4.4vw, 3rem); line-height: 1.12; margin: 1rem 0 1rem;
}
.article-head .deck { font-size: 1.15rem; line-height: 1.6; color: var(--text-muted); margin: 0 0 1.1rem; }

.hero-figure { margin: 0 0 2.5rem; }
.hero-figure img {
  display: block; width: 100%; border-radius: 1.25rem; border: 1px solid var(--border);
  background: #0f0f12; box-shadow: var(--shadow);
}
.hero-figure figcaption, .prose figure figcaption { margin-top: 0.7rem; font-size: 0.85rem; color: var(--text-faint); text-align: center; }

.article-layout { display: grid; gap: 2.5rem; grid-template-columns: minmax(0, 1fr); padding-bottom: 3rem; }
@media (min-width: 1040px) { .article-layout { grid-template-columns: minmax(0, 46rem) 17rem; justify-content: space-between; } }
.article-aside { display: none; }
@media (min-width: 1040px) {
  .article-aside { display: block; position: sticky; top: calc(var(--header-h) + 1.5rem); align-self: start; }
}
.toc, .aside-cta { padding: 1.25rem 1.3rem; background: var(--surface); border: 1px solid var(--border); border-radius: 1rem; }
.toc h2, .aside-cta h2 { margin: 0 0 0.7rem; font: 600 0.7rem/1.2 var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-faint); }
.toc ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.15rem; }
.toc a { display: block; padding: 0.3rem 0; font-size: 0.86rem; line-height: 1.4; color: var(--text-muted); text-decoration: none; }
.toc a:hover { color: var(--brand); }
.aside-cta { margin-top: 1rem; }
.aside-cta p { margin: 0 0 0.9rem; font-size: 0.88rem; color: var(--text-muted); line-height: 1.55; }
.aside-cta .btn { width: 100%; }

.prose { font-size: 1.05rem; }
.prose > *:first-child { margin-top: 0; }
.prose h2 {
  font-family: var(--font-display); font-size: 1.7rem; line-height: 1.25; letter-spacing: -0.015em;
  margin: 3rem 0 1rem; padding-top: 0.5rem; scroll-margin-top: calc(var(--header-h) + 1.5rem);
}
.prose h3 { font-family: var(--font-display); font-size: 1.25rem; line-height: 1.3; margin: 2rem 0 0.7rem; scroll-margin-top: calc(var(--header-h) + 1.5rem); }
.prose h4 { font-size: 1.05rem; margin: 1.5rem 0 0.5rem; scroll-margin-top: calc(var(--header-h) + 1.5rem); }
.prose p, .prose ul, .prose ol, .prose pre, .prose blockquote, .prose figure, .prose .table-wrap { margin: 0 0 1.25rem; }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose li { margin-bottom: 0.45rem; padding-left: 0.2rem; }
.prose li::marker { color: var(--brand); }
.prose strong { color: var(--text); font-weight: 650; }
.prose code {
  font-family: var(--font-mono); font-size: 0.86em; padding: 0.15em 0.4em;
  background: var(--code-bg); border: 1px solid var(--border); border-radius: 0.35rem;
  overflow-wrap: break-word; /* not "anywhere": that shrinks table columns until tokens split mid-word; <wbr> marks the real break points */
}
.prose pre {
  overflow-x: auto; padding: 1.1rem 1.25rem; background: var(--pre-bg); color: var(--pre-text);
  border: 1px solid var(--border); border-radius: 0.9rem; font-size: 0.85rem; line-height: 1.65;
}
.prose pre code { padding: 0; background: none; border: 0; font-size: inherit; overflow-wrap: normal; }
.prose blockquote {
  padding: 1rem 1.25rem; border-left: 4px solid var(--brand); border-radius: 0 0.9rem 0.9rem 0;
  background: color-mix(in srgb, var(--brand) 8%, var(--surface));
}
.prose blockquote p { margin: 0; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2.5rem 0; }
.prose figure { text-align: center; }
.prose figure img { border-radius: 0.9rem; border: 1px solid var(--border); }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 0.9rem; }
.prose table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.prose th, .prose td { padding: 0.7rem 0.95rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
.prose th { background: var(--surface-2); font-weight: 650; white-space: nowrap; }
.prose tr:last-child td { border-bottom: 0; }

.cta-card {
  margin: 3rem 0 0; padding: 2rem 2rem 2.1rem; border-radius: 1.5rem; color: #fff;
  background: radial-gradient(120% 140% at 0% 0%, #d27c6a 0%, #b85b48 45%, #733225 100%);
  box-shadow: 0 10px 40px rgba(184, 91, 72, 0.35);
}
.cta-card h2 { margin: 0 0 0.6rem; font: 700 1.6rem/1.2 var(--font-display); letter-spacing: -0.01em; color: #fff; }
.cta-card p { margin: 0 0 1.4rem; max-width: 36rem; color: rgba(255, 255, 255, 0.92); }
.cta-card .row { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.cta-card .btn-light { background: #fff; color: #18181b; }
.cta-card .btn-light:hover { background: #f4f4f5; color: #18181b; }
.cta-card .btn-outline { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.6); }
.cta-card .btn-outline:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }

.related { padding: 1rem 0 4rem; }
.related > h2 { font: 700 1.5rem/1.2 var(--font-display); margin: 0 0 1.25rem; }

/* ---------------------------------------------------------------- footer */
.site-footer { margin-top: auto; padding: 2.5rem 0; border-top: 1px solid var(--border); background: color-mix(in srgb, var(--surface-2) 50%, transparent); }
.site-footer .container { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.25rem 2rem; }
.footer-brand { display: flex; align-items: center; gap: 0.75rem; font: 600 0.9rem var(--font-display); color: var(--text-muted); }
.footer-brand img { height: 1.75rem; width: auto; }
.footer-links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.4rem; font-size: 0.85rem; }
.footer-links a { color: var(--text-muted); text-decoration: none; }
.footer-links a:hover { color: var(--brand); }
.footer-copy { width: 100%; font-size: 0.8rem; color: var(--text-faint); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
@media (max-width: 520px) {
  .site-header { padding-left: 0.9rem; gap: 0.5rem; }
  .brand-name { display: none; }
  .cta-card { padding: 1.5rem 1.25rem; }
}
