/* Center17 theme: ported from projects.center17.org */
@font-face { font-family: 'System'; src: local('Iosevka'), local('PragmataPro'), local('IBM Plex Mono'), local('SF Mono'), local('Menlo'), local('Consolas'); }
:root { --mono: 'System', 'IBM Plex Mono', 'SF Mono', Menlo, Consolas, monospace; --red: #c8102e; --fg: #d4d4d4; --dim: #888; --rule: #333; --bg: #111; }
* { margin: 0; padding: 0; box-sizing: border-box; }
html { background: var(--bg); }
body { background: var(--bg); color: var(--fg); font-family: 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, serif; font-size: 17px; line-height: 1.7; -webkit-font-smoothing: antialiased; }
::selection { background: var(--red); color: #fff; }
a { color: inherit; text-decoration: none; border-bottom: 1px solid #555; transition: border-color .15s; }
a:hover { border-bottom-color: var(--red); }

.topnav { position: sticky; top: 0; z-index: 10; background: rgba(17,17,17,.94); backdrop-filter: blur(6px); border-bottom: 1px solid #2a2a2a; }
.topnav .inner { max-width: 1100px; margin: 0 auto; padding: 14px 40px; display: flex; align-items: baseline; gap: 28px; font-family: var(--mono); font-size: .74rem; text-transform: uppercase; letter-spacing: .14em; }
.topnav a { border-bottom: none; color: #999; }
.topnav a:hover, .topnav a.current { color: var(--fg); }
.topnav .brand { color: var(--fg); letter-spacing: .08em; margin-right: 12px; }
.topnav .brand b { color: var(--red); font-weight: 700; }
.topnav .ext { margin-left: auto; }
.topnav .ext::after { content: " \2197"; }

.page { max-width: 1100px; margin: 0 auto; padding: 48px 40px 80px; }

.masthead { padding-bottom: 48px; border-bottom: 3px solid var(--fg); margin-bottom: 56px; display: grid; grid-template-columns: 1fr 320px; gap: 40px; align-items: end; }
.masthead h1 { font-family: var(--mono); font-size: 3.2rem; font-weight: 400; letter-spacing: .08em; line-height: 1.1; margin-bottom: 10px; }
.masthead h1 .num { font-weight: 700; color: var(--red); }
.masthead .tagline { font-family: var(--mono); font-size: .95rem; letter-spacing: .12em; text-transform: lowercase; color: var(--fg); }
.masthead .now { font-family: var(--mono); font-size: .74rem; line-height: 1.9; color: var(--dim); }
.masthead .now dt { text-transform: uppercase; letter-spacing: .14em; font-size: .62rem; color: #666; margin-top: 8px; }
.masthead .now dd { margin: 0; }
.masthead .now a { color: #bbb; }
.masthead .now .handle { color: #bbb; }
.masthead.small { display: block; padding-bottom: 24px; margin-bottom: 40px; }
.masthead.small .context { font-family: var(--mono); font-size: 1.4rem; font-weight: 400; letter-spacing: .06em; color: var(--dim); }

.section { position: relative; margin-bottom: 56px; padding-left: 48px; }
.section-label { position: absolute; left: -8px; top: 0; font-family: var(--mono); font-size: .6rem; text-transform: uppercase; letter-spacing: .18em; color: #999; writing-mode: vertical-lr; transform: rotate(180deg); white-space: nowrap; }
.section-rule { width: 100%; height: 1px; background: var(--rule); margin-bottom: 28px; }
.empty { font-family: var(--mono); font-size: .78rem; color: #666; letter-spacing: .06em; }

/* Post index rows: same grammar as the project rows */
.row { display: grid; grid-template-columns: 110px 1fr 70px; gap: 16px; padding: 12px 0; border-bottom: 1px dotted #2a2a2a; align-items: baseline; }
.row:last-child { border-bottom: none; }
.row:hover .row-title { color: var(--red); }
.row-date { font-family: var(--mono); font-size: .74rem; color: #999; }
.row-title { display: block; font-family: var(--mono); font-size: .95rem; font-weight: 700; transition: color .15s; }
.row-desc { display: block; font-size: .9rem; color: var(--dim); margin-top: 2px; }
.row-meta { font-family: var(--mono); font-size: .7rem; color: #999; text-align: right; white-space: nowrap; }

.pagination { display: flex; justify-content: space-between; font-family: var(--mono); font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; color: #999; margin-top: 24px; }
.pagination a { border-bottom: none; }

/* Articles */
.article { max-width: 720px; margin: 0 auto; }
.article-head { margin-bottom: 36px; }
.kicker { font-family: var(--mono); font-size: .7rem; text-transform: uppercase; letter-spacing: .14em; color: #999; margin-bottom: 14px; }
.kicker a { border-bottom: none; color: #bbb; }
.article-title { font-family: var(--mono); font-size: 2rem; font-weight: 400; letter-spacing: .02em; line-height: 1.2; }
.article-excerpt { font-style: italic; color: var(--dim); margin-top: 14px; font-size: 1.05rem; }
.article-image { margin: 0 0 36px; }
.article-image img { width: 100%; height: auto; display: block; }
.article-image figcaption, .content figcaption { font-family: var(--mono); font-size: .68rem; color: #999; margin-top: 8px; letter-spacing: .04em; }
.content { font-size: 18px; }
.content > * + * { margin-top: 1.25em; }
.content h2, .content h3, .content h4 { font-family: var(--mono); font-weight: 400; letter-spacing: .04em; color: var(--fg); margin-top: 2em; }
.content h2 { font-size: 1.25rem; }
.content h3 { font-size: 1rem; text-transform: uppercase; letter-spacing: .12em; color: var(--dim); }
.content h4 { font-size: .9rem; }
.content a { border-bottom-color: #666; }
.content blockquote { border-left: 2px solid var(--red); padding-left: 20px; color: #bbb; font-style: italic; }
.content ul, .content ol { padding-left: 1.4em; }
.content li + li { margin-top: .35em; }
.content hr { border: 0; height: 1px; background: var(--rule); margin: 2.5em 0; }
.content img { max-width: 100%; height: auto; }
.content pre { font-family: var(--mono); font-size: .8rem; line-height: 1.6; background: #0b0b0b; border: 1px solid #2a2a2a; padding: 16px 18px; overflow-x: auto; }
.content code { font-family: var(--mono); font-size: .85em; background: #1a1a1a; padding: .1em .35em; }
.content pre code { background: none; padding: 0; font-size: inherit; }
.content table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.content th, .content td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.content th { font-family: var(--mono); font-size: .68rem; text-transform: uppercase; letter-spacing: .12em; color: #999; font-weight: 400; }
.content .kg-width-wide { margin-left: -120px; margin-right: -120px; }
.content .kg-width-full { margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); }
.content .kg-card + .kg-card { margin-top: 1.5em; }
.content .kg-bookmark-container { border: 1px solid #2a2a2a; text-decoration: none; color: inherit; }
.content .kg-callout-card { background: #1a1a1a; }
.article-foot { margin-top: 48px; padding-top: 16px; border-top: 1px solid var(--rule); font-family: var(--mono); font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; color: #999; }
.article-foot a { border-bottom: none; color: #bbb; }

.site-footer { margin-top: 64px; padding-top: 24px; border-top: 3px solid var(--fg); display: flex; justify-content: space-between; align-items: baseline; font-size: .78rem; color: #999; }
.site-footer nav { display: flex; gap: 20px; }
.site-footer nav a { font-family: var(--mono); font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--dim); border-bottom: none; }
.site-footer nav a:hover { color: var(--red); }

@media (max-width: 700px) {
  .topnav .inner { padding: 12px 20px; gap: 16px; flex-wrap: wrap; }
  .topnav .ext { margin-left: 0; }
  .page { padding: 32px 20px 48px; }
  .masthead { grid-template-columns: 1fr; gap: 24px; }
  .masthead h1 { font-size: 2.2rem; }
  .section { padding-left: 0; }
  .section-label { position: static; writing-mode: horizontal-tb; transform: none; margin-bottom: 12px; display: block; }
  .row { grid-template-columns: 1fr; gap: 4px; }
  .row-meta { text-align: left; }
  .content .kg-width-wide { margin-left: 0; margin-right: 0; }
  .site-footer { flex-direction: column; gap: 12px; }
}

/* Bookmark cards (required by gscan) */
.kg-bookmark-container { display: flex; border: 1px solid #2a2a2a; color: inherit; text-decoration: none; }
.kg-bookmark-content { flex-grow: 1; display: flex; flex-direction: column; padding: 16px 18px; min-width: 0; }
.kg-bookmark-title { font-family: var(--mono); font-size: .9rem; font-weight: 700; color: var(--fg); }
.kg-bookmark-description { font-size: .88rem; color: var(--dim); margin-top: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kg-bookmark-metadata { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-family: var(--mono); font-size: .68rem; color: #999; }
.kg-bookmark-icon { width: 16px; height: 16px; }
.kg-bookmark-author { color: #bbb; }
.kg-bookmark-publisher { color: #999; }
.kg-bookmark-thumbnail { flex-basis: 220px; flex-shrink: 0; position: relative; }
.kg-bookmark-thumbnail img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.kg-bookmark-card { margin: 1.5em 0; }
