/* /systems pages: brand kit v2 (white, black, one #B6D7A8 highlight, IBM Plex). Built by _funnel/_tools/build-systems-pages.py */
:root { --hl: #B6D7A8; --line: #E5E5E5; --muted: rgba(0,0,0,.6); --font: "IBM Plex Sans", system-ui, sans-serif; --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace; }
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; }
body { margin: 0; background: #fff; color: #000; font: 400 18px/1.6 var(--font); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: #000; }
:focus-visible { outline: 2px solid #000; outline-offset: 2px; }
.hl { background: linear-gradient(transparent 55%, var(--hl) 55%); padding: 0 .1em; }
.sys-wrap { max-width: calc(300px + 3rem + 720px + 3rem); margin: 0 auto; padding: 0 1.5rem; }

/* Top bar */
.sys-top { position: sticky; top: 0; z-index: 10; background: #fff; }
.sys-top__in { display: flex; align-items: center; justify-content: space-between; height: 4rem; }
.sys-logo { height: 28px; width: auto; }
.sys-top__link { font: 500 14px/1.4 var(--mono); text-transform: uppercase; letter-spacing: .08em; text-decoration: none; }
.sys-top__link:hover { text-decoration: underline; text-underline-offset: 4px; }

/* Hero */
.sys-hero { padding: 4rem 0 2rem; }
.sys-hero h1 { font-size: 72px; font-weight: 700; line-height: 1; letter-spacing: -0.03em; max-width: 960px; margin: 0 0 1.25rem; }
.sys-lead { font-size: 22px; line-height: 1.5; color: var(--muted); max-width: 680px; margin: 0 0 2rem; }
.sys-by { font: 500 14px/1.4 var(--mono); text-transform: uppercase; letter-spacing: .08em; margin: 0 0 3rem; }
.sys-hero .sys-fig { margin: 0; border: 0; border-radius: 0; max-width: calc(300px + 3rem + 720px); }

/* Layout: TOC + article */
.sys-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 3rem; padding-bottom: 4rem; padding-top: 1rem; }
.sys-toc details { position: sticky; top: 6rem; max-height: calc(100vh - 8rem); overflow: auto; }
.sys-toc summary { font: 500 14px/1.4 var(--mono); text-transform: uppercase; letter-spacing: .08em; cursor: pointer; list-style: none; margin-bottom: 1rem; }
.sys-toc summary::-webkit-details-marker { display: none; }
.sys-toc ol { list-style: none; margin: 0; padding: 0; counter-reset: t; }
.sys-toc li { counter-increment: t; margin: 0 0 .5rem; font-size: 14px; line-height: 1.35; }
.sys-toc li::before { content: counter(t, decimal-leading-zero); font: 500 12px/1 var(--mono); letter-spacing: .08em; color: var(--muted); margin-right: .5rem; }
.sys-toc a { text-decoration: none; color: var(--muted); }
.sys-toc a:hover { color: #000; }

/* Article type */
.sys-body { max-width: 720px; }
.sys-body h2 { font-size: 32px; font-weight: 600; line-height: 1.15; letter-spacing: -0.015em; margin: 3.5rem 0 1rem; }
.sys-body > h2:first-child { margin-top: 0; }
.sys-body h3 { font-size: 22px; font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; margin: 3rem 0 .75rem; }
.sys-body h4 { font-size: 18px; font-weight: 600; margin: 2rem 0 .5rem; }
.sys-body p, .sys-body li { font-size: 18px; line-height: 1.6; }
.sys-body p { margin: 0 0 1rem; }
.sys-body ul, .sys-body ol { padding-left: 1.5rem; margin: 0 0 1.25rem; }
.sys-body li { margin: 0 0 .5rem; }
.sys-body strong { font-weight: 700; }
.sys-body blockquote { margin: 1.5rem 0; padding: .25rem 0 .25rem 1.25rem; border-left: 2px solid #000; }
.sys-body blockquote p { font-style: italic; }
.sys-body hr { border: 0; margin: 1.5rem 0; }
.sys-body code { font: 15px var(--mono); }
.sys-fig { margin: 2rem 0; }
.sys-fig img { width: 100%; }

/* Tables */
.sys-table { overflow-x: auto; margin: 1.5rem 0 2rem; }
.sys-body table { width: 100%; border-collapse: collapse; font-size: 16px; line-height: 1.5; }
.sys-body th { text-align: left; font: 500 14px/1.4 var(--mono); text-transform: uppercase; letter-spacing: .08em; border-bottom: 1px solid #000; padding: .5rem .75rem .5rem 0; vertical-align: bottom; }
.sys-body td { border-bottom: 1px solid var(--line); padding: .75rem .75rem .75rem 0; vertical-align: top; }

/* Prev / next */
.sys-pn { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 4rem; }
.sys-pn a { display: block; text-decoration: none; font-weight: 600; font-size: 20px; line-height: 1.3; padding: 1.25rem; border: 1px solid var(--line); border-radius: 4px; }
.sys-pn a:hover { border-color: #000; }
.sys-pn span { display: block; font: 500 14px/1.4 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: .5rem; }
.sys-pn__next { text-align: right; grid-column: 2; }

/* Index cards */
.sys-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem; padding-bottom: 4rem; }
.sys-card { display: block; text-decoration: none; border: 1px solid var(--line); border-radius: 4px; padding: 1.5rem; }
.sys-card:hover { border-color: #000; }
.sys-card img { margin-bottom: 1.5rem; }
.sys-card .sys-step { font: 500 14px/1.4 var(--mono); letter-spacing: .08em; }
.sys-card h2 { font-size: 24px; font-weight: 600; line-height: 1.15; letter-spacing: -0.015em; margin: .5rem 0 .75rem; }
.sys-card p { color: var(--muted); margin: 0; }

/* Footer */
.sys-foot { padding: 1.5rem 0 3rem; }
.sys-foot p { font-size: 14px; color: var(--muted); margin: 1rem 0 0; }

@media (max-width: 900px) {
  .sys-grid { grid-template-columns: 1fr; gap: 2rem; }
  .sys-toc details { position: static; max-height: none; border: 1px solid var(--line); border-radius: 4px; padding: 1rem; }
  .sys-toc summary { margin: 0; }
  .sys-toc details[open] summary { margin-bottom: 1rem; }
  .sys-cards { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .sys-wrap { padding: 0 1rem; }
  .sys-hero { padding: 3rem 0 2rem; }
  .sys-hero h1 { font-size: 44px; }
  .sys-lead { font-size: 20px; }
  .sys-body h2 { font-size: 26px; margin-top: 3rem; }
  .sys-body h3 { font-size: 20px; }
  .sys-pn { grid-template-columns: 1fr; }
  .sys-pn__next { grid-column: 1; }
  .sys-grid { padding-bottom: 3rem; }
}

/* Interaction details (emil-design-eng pass) */
:root { --ease-out: cubic-bezier(0.23, 1, 0.32, 1); }
html { -webkit-tap-highlight-color: transparent; }
.sys-hero h1, .sys-body h2, .sys-body h3, .sys-card h2 { text-wrap: balance; }
.sys-body p, .sys-lead, .sys-card p { text-wrap: pretty; }
.sys-pn a, .sys-card { transition: border-color 150ms ease, transform 160ms var(--ease-out); }
.sys-pn a:hover, .sys-card:hover { border-color: var(--line); }
@media (hover: hover) and (pointer: fine) {
  .sys-pn a:hover, .sys-card:hover { border-color: #000; }
  .sys-toc a:hover { color: #000; }
}
.sys-pn a:active, .sys-card:active { transform: scale(0.98); }
.sys-toc a { transition: color 150ms ease; }
.sys-toc a.is-active { color: #000; font-weight: 600; }
.js .sys-fig img, .js .sys-card img { opacity: 0; transition: opacity 240ms var(--ease-out); }
.js .sys-fig img.is-loaded, .js .sys-card img.is-loaded { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .sys-pn a:active, .sys-card:active { transform: none; }
}

.sys-fig img { cursor: zoom-in; }

/* Full-screen image view */
.sys-zoom { border: 0; padding: 0; margin: 0; width: 100vw; height: 100vh; max-width: none; max-height: none; background: #fff; cursor: zoom-out; }
.sys-zoom::backdrop { background: #fff; }
.sys-zoom img { width: 100%; height: 100%; object-fit: contain; padding: 1.5rem; opacity: 1; }
.sys-zoom[open] { animation: sys-zoom-in 200ms var(--ease-out); }
@keyframes sys-zoom-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .sys-zoom[open] { animation-duration: 1ms; } }
