/* /writing/writing.css: styles for the Writing index and every post.
   Loaded after /styles.css, which supplies the design tokens, base type,
   skip link, focus rings, header and footer. Rules here that share a
   selector with styles.css override it on writing pages only.
   No inline styles on any page, so the CSP (style-src 'self') holds. */
:root {
  --plate: #1F2F3B;
  --plate-edge: #2C3F4D;
  --plate-text: #E7ECEA;
  --plate-muted: #9FB0B8;
}
footer { margin-top: 4rem; }
.crumb { font-size: 0.9375rem; color: var(--muted); margin: 0 0 1rem; }
.crumb a { color: var(--muted); }

/* Writing index */
.index-head { padding: 3rem 0 2.5rem; border-bottom: 2px solid var(--ink); }
.index-head h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); line-height: 1.02; letter-spacing: -0.035em; font-weight: 800; margin: 0 0 1rem; max-width: none; }
.index-head p { color: var(--muted); font-size: 1.1875rem; max-width: 38rem; margin: 0; }
.posts { list-style: none; margin: 0; padding: 0; }
.post-item { display: grid; grid-template-columns: 9rem 1fr; gap: 2rem; padding: 2rem 0; border-bottom: 1px solid var(--rule); }
.post-item time { color: var(--muted); font-size: 0.9375rem; padding-top: 0.3rem; }
.post-item h2 { font-weight: 700; font-size: 1.5rem; line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 0.5rem; }
.post-item h2 a { color: var(--ink); text-decoration: none; }
.post-item h2 a:hover { text-decoration: underline; text-decoration-color: var(--cable); text-decoration-thickness: 0.15em; }
.post-item p { margin: 0 0 0.5rem; max-width: 40rem; }
.post-item .meta { color: var(--muted); font-size: 0.9375rem; }

/* Article */
.article { max-width: 44rem; margin: 0 auto; padding: 2.5rem 0 0; }
.article h1 { font-size: clamp(2.2rem, 4.6vw, 3.25rem); line-height: 1.05; letter-spacing: -0.035em; font-weight: 800; margin: 0 0 1rem; max-width: none; }
.byline { color: var(--muted); font-size: 0.9375rem; margin: 0 0 2rem; display: flex; gap: 1.25rem; flex-wrap: wrap; }
.summary { background: var(--plate); color: var(--plate-text); border-left: 6px solid var(--cable); border-radius: 4px; padding: 1.25rem 1.5rem; margin: 0 0 2.5rem; font-size: 1.0625rem; }
.summary strong { color: var(--cable); display: block; font-size: 0.875rem; margin-bottom: 0.35rem; }
.summary p { margin: 0; }
.article h2 { font-weight: 700; font-size: 1.625rem; letter-spacing: -0.02em; line-height: 1.2; margin: 2.75rem 0 0.85rem; }
.article p, .article li { font-size: 1.125rem; line-height: 1.7; }
.article p { margin: 0 0 1.15rem; }
.article ul, .article ol { margin: 0 0 1.25rem; padding-left: 1.35rem; }
.article li { margin-bottom: 0.4rem; }
.article code { font-family: var(--mono); font-size: 0.92em; background: #E1E6E3; padding: 0.08em 0.35em; border-radius: 3px; }
.article pre { background: var(--plate); color: var(--plate-text); font-family: var(--mono); font-size: 0.9rem; line-height: 1.6; padding: 1.1rem 1.25rem; border-radius: 4px; overflow-x: auto; margin: 0 0 1.5rem; }
.article pre code { background: none; padding: 0; font-size: inherit; color: inherit; }
.article pre .hl { color: var(--cable); font-weight: 700; }

/* Speed table */
.speeds { width: 100%; border-collapse: collapse; margin: 0 0 1.5rem; font-size: 1.0625rem; }
.speeds th { text-align: left; font-size: 0.875rem; color: var(--muted); font-weight: 600; padding: 0 1rem 0.6rem 0; border-bottom: 2px solid var(--ink); }
.speeds td { padding: 0.85rem 1rem 0.85rem 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.speeds td.num { font-family: var(--mono); font-weight: 700; white-space: nowrap; }
.speeds td.num.win { background: var(--cable); }

/* Path diagram */
.diagram { margin: 0.5rem 0 2rem; }
.diagram-panel:focus-visible { outline: 3px solid var(--signal); outline-offset: 3px; }
.diagram-panel { background: var(--plate); border-radius: 6px; padding: 1rem; overflow-x: auto; border-bottom: 3px solid #121C24; }
.paths { display: block; width: 100%; min-width: 620px; height: auto; }
.paths text { font-family: var(--sans); fill: var(--plate-text); font-size: 13px; }
.paths .lane { font-weight: 700; font-size: 14px; }
.paths .small { font-size: 11.5px; fill: var(--plate-muted); }
.paths .speed { font-family: var(--mono); font-size: 13px; font-weight: 700; }
.paths .box { fill: var(--plate); stroke: var(--plate-text); stroke-width: 1.5; }
.paths .box.gw { stroke: var(--signal); }
.paths .box.fw { stroke: var(--plate-muted); }
.paths .link { stroke: #6B8394; stroke-width: 3; }
.paths .link.fast { stroke: var(--signal); stroke-width: 5; }
.paths .link.cap { stroke: var(--cable); stroke-width: 3; }
.paths .badge { fill: var(--cable); }
.paths .badge-text { fill: var(--ink); font-weight: 700; font-size: 11.5px; }
.paths .speed.cap { fill: var(--cable); }
.paths .speed.fast { fill: #8DB8E6; }
.diagram figcaption { font-size: 0.9375rem; color: var(--muted); margin-top: 0.75rem; max-width: none; }

.callout { border-left: 4px solid var(--signal); padding: 0.25rem 0 0.25rem 1.25rem; margin: 0 0 1.5rem; color: var(--ink); }
.related { margin-top: 3rem; padding-top: 1.5rem; border-top: 2px solid var(--ink); }
.related h2 { font-size: 1.125rem; margin: 0 0 0.75rem; }
.related ul { list-style: none; padding: 0; margin: 0 0 1.25rem; }
.related li { margin-bottom: 0.4rem; font-size: 1.0625rem; }

@media (max-width: 720px) {
  .post-item { grid-template-columns: 1fr; gap: 0.25rem; }
  .article p, .article li { font-size: 1.0625rem; }
}
