/* complex.md site styles, 2026-09-03: mirrors agents.md (MIT) as closely as
   the house rules allow. Its grammar: white ground and near-black ink
   (dark mode inverts to near-black and off-white), gray-50 bands, gray
   hairlines, one sans for everything, the artifact as the hero's second
   column. House deviation, deliberate: 4px radii everywhere, never pills.
   Space Mono carries file contents and numerals; the ember heat ramp stays,
   data ink only. platform.css loads first as the layered token floor;
   everything here wins over it. */

@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('/fonts/inter-latin-var.woff2?v=3100e775') format('woff2'); }
@font-face { font-family: 'Space Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/space-mono-400-latin.woff2?v=fb4a81a2') format('woff2'); }
@font-face { font-family: 'Space Mono'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/space-mono-700-latin.woff2?v=2d46bd15') format('woff2'); }

:root {
  --ink: #171717; --muted: #6b7280; --ground: #ffffff; --band: #f9fafb;
  --panel: #fcfcfc; --line: #e5e7eb;
  --heat-1: #E8B04B; --heat-2: #D97E2E; --heat-3: #C24E14;
  --radius: 4px;
  --cx-display: 'Inter', -apple-system, 'Segoe UI', sans-serif;
  --cx-sans: 'Inter', -apple-system, 'Segoe UI', sans-serif;
  --cx-mono: 'Space Mono', ui-monospace, monospace;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #ededed; --muted: #9ca3af; --ground: #0a0a0a; --band: #111318;
    --panel: #101012; --line: #26272b;
    --heat-3: #E07A3E;
  }
}

* { box-sizing: border-box; }
body { margin: 0; font-family: var(--cx-sans); background: var(--ground); color: var(--ink); line-height: 1.65; }
a { color: var(--ink); text-underline-offset: 3px; }
.display, h1, h2, h3 { font-family: var(--cx-display); font-weight: 600; }
.inner { max-width: 64rem; margin: 0 auto; padding-left: 1.5rem; padding-right: 1.5rem; }

/* Chrome (owner, 2026-09-02): the complex.md file chip is the logo and home
   link; the small square beside it is the skill download, arrow only. Both
   share the chip height so they read as one unit. */
.site-header { border-bottom: 1px solid var(--line); background: var(--ground); }
.site-header nav { max-width: 64rem; margin: 0 auto; padding: 0.8rem 1.5rem; display: flex; align-items: center; gap: 1.5rem; }
.brand-group { display: inline-flex; align-items: center; gap: 6px; margin-right: auto; }
.brand-chip { font-family: var(--cx-mono); font-weight: 700; font-size: 0.85rem; text-decoration: none; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.4rem 0.7rem; line-height: 1; }
.brand-chip:hover { border-color: var(--ink); }
.dl-sq { display: inline-flex; align-items: center; justify-content: center; width: calc(1.65rem + 2px); height: calc(1.65rem + 2px); text-decoration: none; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.dl-sq svg { display: block; }
.dl-sq:hover, .gh-sq:hover { border-color: var(--ink); }
.site-header a.nav { font-size: 0.86rem; text-decoration: none; }
.site-header a.nav:hover { text-decoration: underline; }
/* Source link: the same square as the download chip, GitHub mark only. */
.gh-sq { display: inline-flex; align-items: center; justify-content: center; width: calc(1.65rem + 2px); height: calc(1.65rem + 2px); color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; }
.gh-sq svg { display: block; }
.site-footer { border-top: 1px solid var(--line); }
.site-footer .inner { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding-top: 1.3rem; padding-bottom: 2rem; }
.site-footer small { color: var(--muted); font-size: 0.8rem; }
.site-footer small a { color: inherit; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.site-footer small a:hover { text-decoration-color: var(--ink); }
.site-footer .vers { font-family: var(--cx-mono); font-size: 0.72rem; }

/* Doc pages: spec, skill, articles. platform.css zeroes every block margin
   and strips underlines as its floor; a document restores its rhythm here.
   Measure 42rem, one blank line between paragraphs, hairline above each
   section, an "On this page" list that sits in the margin on wide screens. */
main.doc { max-width: 44rem; margin: 0 auto; padding: 2.75rem 1.5rem 4.5rem; }
main.doc .doc-head { margin-bottom: 2.25rem; }
main.doc h1 { font-size: clamp(1.7rem, 1rem + 3vw, 2.4rem); letter-spacing: -0.018em; line-height: 1.12; margin: 0 0 0.75rem; overflow-wrap: break-word; }
main.doc .kicker, p.dateline { font-family: var(--cx-mono); font-size: 0.74rem; color: var(--muted); margin: 0; letter-spacing: 0.01em; }
main.doc .kicker a, p.dateline a { color: inherit; }
main.doc .doc-head > p:not(.kicker):not(.dateline), main.doc .lede { font-size: 1.12rem; line-height: 1.6; color: var(--ink); margin: 1.1rem 0 0; }
main.doc h2 { font-size: 1.4rem; letter-spacing: -0.012em; line-height: 1.25; margin: 3rem 0 1rem; padding-top: 1.4rem; border-top: 1px solid var(--line); }
main.doc h3 { font-size: 1.08rem; line-height: 1.35; margin: 2rem 0 0.6rem; }
main.doc h3 code { font-weight: 400; font-size: 0.82em; }
main.doc p, main.doc li { font-size: 1rem; line-height: 1.7; }
main.doc p { margin: 0 0 1.1rem; }
main.doc ul, main.doc ol { margin: 0 0 1.2rem; padding-left: 1.35rem; }
main.doc li { margin: 0 0 0.45rem; padding-left: 0.15rem; }
main.doc li::marker { font-family: var(--cx-mono); font-size: 0.85em; color: var(--muted); }
main.doc a { text-decoration: underline; text-decoration-color: #B9B7B0; text-decoration-thickness: 1px; text-underline-offset: 3px; }
main.doc a:hover { text-decoration-color: var(--ink); }
main.doc a.btn, main.doc a.cta { text-decoration: none; margin: 0.25rem 0 0.5rem; }
main.doc p > strong:first-child { font-family: var(--cx-display); font-weight: 600; }
main.doc blockquote { margin: 0 0 1.1rem; padding: 0.1rem 0 0.1rem 1rem; border-left: 2px solid var(--line); color: var(--muted); }
pre { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.95rem 1.1rem; margin: 0 0 1.3rem; font-size: 0.78rem; line-height: 1.6; overflow-x: auto; }
pre code { font-family: var(--cx-mono); }
p code, li code, td code { font-family: var(--cx-mono); font-size: 0.85em; background: var(--panel); border: 1px solid var(--line); border-radius: 3px; padding: 0.08em 0.3em; overflow-wrap: anywhere; }
table { border-collapse: collapse; width: 100%; font-size: 0.85rem; margin: 0 0 1.3rem; display: block; overflow-x: auto; }
thead th { font-family: var(--cx-mono); font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 400; text-align: left; padding: 0.4rem 0.9rem 0.4rem 0; border-bottom: 1px solid var(--ink); }
tbody td { padding: 0.5rem 0.9rem 0.5rem 0; border-bottom: 1px solid var(--line); vertical-align: top; line-height: 1.5; }

/* On this page. A details block above the text on narrow screens; on wide
   screens it moves into the right margin and stays put while you scroll. */
.toc { margin: 0 0 2rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.toc summary { font-family: var(--cx-mono); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding: 0.65rem 0.9rem; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.toc summary::-webkit-details-marker { display: none; }
.toc summary::after { content: "+"; font-size: 0.9rem; }
.toc[open] summary::after { content: "\2013"; }
.toc ol { list-style: none; margin: 0; padding: 0 0.9rem 0.6rem; }
.toc li { font-size: 0.88rem; margin: 0; padding: 0.22rem 0; }
.toc li::marker { content: none; }
main.doc .toc a { text-decoration: none; color: var(--ink); }
main.doc .toc a:hover { text-decoration: underline; }
@media (min-width: 1180px) {
  main.doc.has-toc { position: relative; }
  .toc-wrap { position: absolute; top: 2.75rem; bottom: 0; left: calc(100% + 2.5rem); width: 15rem; }
  .toc { position: sticky; top: 1.5rem; margin: 0; border: 0; background: transparent; }
  .toc summary { padding: 0 0 0.5rem; pointer-events: none; }
  .toc summary::after { content: none; }
  .toc ol { padding: 0; border-left: 1px solid var(--line); }
  .toc li { font-size: 0.82rem; padding: 0.18rem 0 0.18rem 0.85rem; color: var(--muted); }
  main.doc .toc li a { color: var(--muted); }
  main.doc .toc li a:hover { color: var(--ink); text-decoration: none; }
}

/* Buttons (4px, never pills) */
.btn, .cta { display: inline-block; font-size: 0.9rem; font-weight: 600; text-decoration: none; border-radius: var(--radius); padding: 0.6rem 1.1rem; }
.btn.solid, .cta { background: var(--ink); color: var(--ground); }
.btn.line { border: 1px solid var(--ink); }
.btn.solid:hover, .cta:hover { opacity: 0.85; }

/* Home bands. The hero mirrors agents.md: two columns on a gray-50 band,
   the wordmark as the h1, the artifact as the second column. */
main.full { padding: 0; }
.hero { background: var(--band); border-bottom: 1px solid var(--line); }
.hero .inner { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 3rem; padding-top: 5rem; padding-bottom: 5rem; align-items: start; }
.hero h1.wordmark { font-size: clamp(2.4rem, 1.2rem + 5.5vw, 3.75rem); font-weight: 700; line-height: 1.05; letter-spacing: -0.025em; margin: 0 0 1.1rem; overflow-wrap: break-word; }
.hero .pitch { font-size: 1.1rem; max-width: 30rem; margin: 0 0 1.5rem; color: var(--muted); }
.btn.line svg { vertical-align: -2px; margin-right: 0.4rem; }
.install { display: inline-flex; align-items: center; gap: 0.75rem; font-family: var(--cx-mono); font-size: 0.9rem; background: var(--ground); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.65rem 1rem; margin-bottom: 1.2rem; }
.install .p { color: var(--muted); }
.ctas { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.band { padding: 3.2rem 0; }
.band.alt { background: var(--band); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.band h2 { font-size: clamp(1.25rem, 0.9rem + 1.8vw, 1.6rem); letter-spacing: -0.01em; margin: 0 0 0.9rem; }
.band p { max-width: 42rem; margin: 0 0 0.9rem; }
.cols3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; margin-top: 1.5rem; }
.step { border: 1px solid var(--line); border-radius: var(--radius); background: var(--ground); padding: 1.1rem 1.2rem; }
.step .n { font-family: var(--cx-mono); font-size: 0.7rem; color: var(--muted); letter-spacing: 0.08em; }
.step h3 { font-size: 1rem; margin: 0.3rem 0 0.4rem; }
.step p { font-size: 0.88rem; color: var(--muted); margin: 0; line-height: 1.5; }
.step code { font-size: 0.8rem; }

/* The artifact card */
.file-card { background: var(--ground); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.file-card .bar { display: flex; justify-content: space-between; align-items: baseline; gap: 0.3rem 0.75rem; padding: 0.55rem 1rem; border-bottom: 1px solid var(--line); background: var(--panel); flex-wrap: wrap; }
.file-card .fname { font-family: var(--cx-mono); font-weight: 700; font-size: 0.78rem; }
.file-card .ftag { font-family: var(--cx-mono); font-size: 0.66rem; color: var(--muted); }
.file-card pre { margin: 0; padding: 0.9rem 1rem; border: 0; border-radius: 0; background: var(--ground); font-family: var(--cx-mono); font-size: 0.68rem; line-height: 1.55; }
.file-card .fm { color: var(--muted); }
.file-card .fm .k { color: var(--ink); }
.file-card .fm .hot { color: var(--heat-3); }
.file-card .prose-h { font-weight: 700; }

/* Compatibility list: text chips, not logos. */
.compat { list-style: none; display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 1.4rem 0 0; padding: 0; }
.compat li { border: 1px solid var(--line); border-radius: var(--radius); background: var(--ground); padding: 0.45rem 0.85rem; font-size: 0.88rem; }
.band.alt .compat li { background: var(--ground); }

/* Four steps on wide screens, two on tablets, one on phones. */
.cols4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1080px) { .cols4 { grid-template-columns: repeat(2, 1fr); } }

/* FAQ: question, answer, hairline rhythm. */
.faq { max-width: 42rem; }
.faq h3 { font-size: 1.02rem; margin: 1.6rem 0 0.4rem; }
.faq h3:first-child { margin-top: 0.4rem; }
.faq p { font-size: 0.95rem; color: var(--muted); margin: 0 0 0.4rem; }
.faq p a { color: inherit; }
.about p { max-width: 46rem; }

/* Articles index */
.article-list { list-style: none; padding: 0; }
.article-list li { margin: 1.3rem 0; }
.article-list a { font-family: var(--cx-display); font-weight: 600; font-size: 1.05rem; }
.article-list .dim { color: var(--muted); font-size: 0.9rem; }
.article-list time { font-family: var(--cx-mono); color: var(--muted); font-size: 0.72rem; }
.example figcaption { font-size: 0.85rem; color: var(--muted); margin-top: 0.4rem; }
.lede { font-size: 1.05rem; }

@media (max-width: 860px) {
  .hero .inner { grid-template-columns: 1fr; gap: 2rem; }
  .cols3 { grid-template-columns: 1fr; }
  .site-header nav { gap: 1rem; }
}

/* Small phones. Tighter chrome, calmer bands, honest tap targets. */
@media (max-width: 600px) {
  .inner { padding-left: 1rem; padding-right: 1rem; }
  .site-header nav { padding: 0.75rem 1rem; }
  main.doc { padding: 1.75rem 1rem 3rem; }
  main.doc .doc-head { margin-bottom: 1.6rem; }
  main.doc h2 { font-size: 1.28rem; margin-top: 2.4rem; padding-top: 1.2rem; }
  main.doc p, main.doc li { font-size: 0.97rem; line-height: 1.65; }
  main.doc .doc-head > p:not(.kicker):not(.dateline), main.doc .lede { font-size: 1.04rem; }
  main.doc ul, main.doc ol { padding-left: 1.2rem; }
  /* Long lines wrap rather than scroll: a regex or a YAML block is read, not copied, on a phone. */
  main.doc pre { white-space: pre-wrap; overflow-wrap: anywhere; }
  .toc { margin-bottom: 1.6rem; }
  .hero .inner { padding-top: 2.25rem; padding-bottom: 2.5rem; gap: 1.75rem; }
  .hero .pitch { font-size: 1rem; }
  .band { padding: 2.25rem 0; }
  .band p { font-size: 0.95rem; }
  .btn, .cta { padding: 0.7rem 1.1rem; }
  .install { font-size: 0.85rem; padding: 0.6rem 0.9rem; }
  .brand-group { gap: 4px; }
  .file-card pre { font-size: 0.64rem; padding: 0.75rem 0.8rem; }
  .file-card .bar { padding: 0.5rem 0.8rem; }
  pre { font-size: 0.74rem; padding: 0.75rem 0.8rem; }
  .step { padding: 1rem; }
  .site-footer .inner { flex-direction: column; gap: 0.3rem; padding-bottom: 1.6rem; }
}

/* Down to 320px. Buttons and the install line go full width and stack;
   nav tightens so the download chip wraps cleanly instead of clipping. */
@media (max-width: 380px) {
  .site-header nav { gap: 0.8rem; }
  .brand-chip { font-size: 0.78rem; padding: 0.35rem 0.55rem; }
  .dl-sq, .gh-sq { width: calc(1.48rem + 2px); height: calc(1.48rem + 2px); }
  .dl-sq svg, .gh-sq svg { width: 12px; height: 12px; }
  .site-header a.nav { font-size: 0.82rem; }
  .install { display: flex; width: 100%; justify-content: flex-start; }
  .ctas { flex-direction: column; }
  .ctas .btn { width: 100%; text-align: center; }
  .cta { display: block; text-align: center; }
  .file-card .ftag { font-size: 0.62rem; }
}
