/* Footer */
.sr-footer { width: min(var(--page), calc(100% - 48px)); margin: 0 auto; border: 1px solid var(--line); border-top: 0; background: var(--panel); }
.sr-footer-inner { display: grid; grid-template-columns: 1.1fr 1fr 1fr; gap: 38px; padding: 40px 44px; }
.sr-footer-wordmark { font: 750 13px/1.3 var(--mono); text-decoration: none; }
.sr-footer p { margin: 8px 0 0; color: var(--muted); font: 10px/1.5 var(--mono); }
.sr-footer .sr-nav-list, .sr-secondary-nav { align-items: flex-start; flex-direction: column; gap: 9px; list-style: none; margin: 0; padding: 0; }
.sr-footer .sr-nav-item a, .sr-secondary-nav a { padding: 0; color: var(--muted); font: 10px/1.5 var(--mono); text-decoration: none; }
.sr-footer .sr-nav-item a::after { display: none; }
.sr-footer .sr-nav-item a:hover, .sr-secondary-nav a:hover { color: var(--accent); }
.sr-footer-bottom { display: flex; justify-content: space-between; gap: 20px; padding: 14px 44px; border-top: 1px solid var(--line); color: var(--muted); font: 9px/1.4 var(--mono); }

/* Mode line */
.sr-mode-line {
    position: fixed; z-index: 120; left: 0; right: 0; bottom: 0; height: 34px;
    display: flex; align-items: center; gap: 0;
    border-top: 1px solid var(--line-strong); background: var(--mode-bg); color: var(--ink);
    box-shadow: 0 -2px 8px rgba(0,0,0,.04); font: 10px/1 var(--mono); user-select: none;
}
.sr-mode-line > span { height: 100%; display: inline-flex; align-items: center; padding: 0 11px; border-right: 1px solid var(--line); white-space: nowrap; }
.sr-mode-brand { background: var(--teal); color: #fff; font-weight: 800; }
.sr-mode-spacer { flex: 1; }

/* Command/help overlays */
.sr-overlay { position: fixed; z-index: 500; inset: 0; display: grid; place-items: start center; padding-top: min(18vh, 160px); background: rgba(8, 15, 19, .48); backdrop-filter: blur(4px); }
.sr-palette { width: min(680px, calc(100% - 32px)); overflow: hidden; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--panel); box-shadow: 0 28px 80px rgba(0,0,0,.28); }
.sr-palette-title { padding: 12px 15px; border-bottom: 1px solid var(--line); color: var(--teal); font: 800 12px/1 var(--mono); }
.sr-palette input { width: 100%; height: 52px; padding: 0 15px; border: 0; border-bottom: 1px solid var(--line); outline: 0; background: var(--bg-raised); color: var(--ink); font: 13px/1 var(--mono); }
.sr-command-list { max-height: min(52vh, 390px); overflow: auto; }
.sr-command { width: 100%; display: grid; grid-template-columns: 180px 1fr auto; gap: 14px; align-items: center; padding: 11px 15px; border: 0; border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.sr-command:hover, .sr-command.is-active { background: var(--panel-soft); }
.sr-command b { color: var(--accent); font: 700 10px/1.3 var(--mono); }
.sr-command span { color: var(--muted); font: 10px/1.4 var(--mono); }
.sr-command kbd { color: var(--muted); font: 9px/1 var(--mono); }
.sr-bindings { margin: 0; padding: 10px 15px 16px; }
.sr-bindings > div { display: flex; justify-content: space-between; gap: 24px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.sr-bindings dt, .sr-bindings dd { margin: 0; font: 10px/1.4 var(--mono); }
.sr-bindings dd { color: var(--accent); }

/* Ghost comments */
#ghost-comments-root { max-width: 900px; margin: 0 auto; padding: 20px 44px 70px; }

/* Responsive */
@media (max-width: 1080px) {
    .sr-nav-list { gap: 16px; }
    .sr-nav-item a { font-size: 11px; }
    .sr-selected-grid { grid-template-columns: 1fr; }
    .sr-project-stack { grid-template-columns: 1fr 1fr; grid-template-rows: none; }
    .sr-article-shell { grid-template-columns: minmax(0, var(--content)) 190px; justify-content: center; }
    .sr-article-gutter { display: none; }
    .sr-output-band { grid-template-columns: 1fr 1fr 1fr; }
    .sr-output-title { grid-column: 1 / -1; min-height: 70px; border-bottom: 1px solid var(--line); }
    .sr-output-band > a:nth-last-child(1) { border-right: 0; }
}

@media (max-width: 900px) {
    .sr-header-inner, .sr-main, .sr-footer { width: min(100% - 28px, var(--page)); }
    .sr-nav { display: none; }
    .sr-mobile-menu-button { display: inline-grid; }
    .sr-subscribe { display: none; }
    .sr-hero { grid-template-columns: 1fr; }
    .sr-hero-copy { padding: 62px 42px 48px; }
    .sr-hero-visual { min-height: 460px; border-left: 0; border-top: 1px solid var(--line); }
    .sr-hero-portrait { height: 520px; }
    .sr-credentials { grid-template-columns: 1fr 1fr; }
    .sr-credentials > div:nth-child(2) { border-right: 0; }
    .sr-credentials > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
    .sr-focus-grid { grid-template-columns: 1fr 1fr; }
    .sr-focus:nth-child(2) { border-right: 0; }
    .sr-focus:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
    .sr-project-stack { grid-template-columns: 1fr; }
    .sr-lab-grid { grid-template-columns: 1fr; }
    .sr-lab-grid a { border-right: 0; border-bottom: 1px solid var(--line); }
    .sr-lab-grid a:last-child { border-bottom: 0; }
    .sr-newsletter { grid-template-columns: 1fr; }
    .sr-page-hero, .sr-about-hero, .sr-project-hero { grid-template-columns: 1fr; }
    .sr-buffer-index { min-height: 92px; border-left: 0; border-top: 1px solid var(--line); flex-direction: row; }
    .sr-about-image { min-height: 430px; border-right: 0; border-bottom: 1px solid var(--line); }
    .sr-about-image img { max-height: 560px; object-position: center 20%; }
    .sr-project-hero-image { min-height: 380px; border-left: 0; border-top: 1px solid var(--line); }
    .sr-article-shell { grid-template-columns: minmax(0, var(--content)); padding-left: 44px; padding-right: 44px; }
    .sr-toc { position: relative; top: 0; grid-row: 1; max-height: none; padding: 16px 18px; border: 1px solid var(--line); background: var(--panel); }
    .sr-toc nav { columns: 2; column-gap: 24px; }
    .sr-post-header-inner { padding-top: 56px; }
    .sr-footer-inner { grid-template-columns: 1fr 1fr; }
    .sr-footer-inner > nav:last-child { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
    body { padding-bottom: 31px; }
    .sr-header { height: 62px; }
    .sr-header-inner { width: calc(100% - 28px); }
    .sr-mobile-menu { top: 61px; }
    .sr-header-actions .sr-icon-button:not(.sr-mobile-menu-button):first-child { display: none; }
    .sr-main, .sr-footer { width: calc(100% - 16px); }
    .sr-wordmark { font-size: 11px; }
    .sr-section { padding: 46px 20px; }
    .sr-section-head { align-items: start; flex-direction: column; gap: 12px; }
    .sr-section-head h2 { font-size: 21px; }
    .sr-section-head p { font-size: 16px; }
    .sr-hero-copy { padding: 52px 24px 40px; }
    .sr-hero h1 { font-size: clamp(42px, 14vw, 58px); }
    .sr-hero-statement { font-size: 21px; }
    .sr-hero-visual { min-height: 390px; }
    .sr-hero-portrait { height: 430px; }
    .sr-credentials { grid-template-columns: 1fr; }
    .sr-credentials > div { min-height: 54px; border-right: 0; border-bottom: 1px solid var(--line); }
    .sr-credentials > div:last-child { border-bottom: 0; }
    .sr-focus-grid { grid-template-columns: 1fr; }
    .sr-focus { border-right: 0; border-bottom: 1px solid var(--line); }
    .sr-focus:last-child { border-bottom: 0; }
    .sr-selected-grid { gap: 10px; }
    .sr-featured-story { min-height: 350px; }
    .sr-featured-story-copy { padding: 20px; }
    .sr-project-card { grid-template-columns: 1fr; }
    .sr-project-card-visual { height: 180px; grid-row: 1; }
    .sr-post-row { grid-template-columns: 1fr auto; gap: 9px 18px; padding: 20px 0; }
    .sr-post-row-meta { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; }
    .sr-post-row-main { grid-column: 1 / -1; }
    .sr-post-row-main h2 { font-size: 15px; }
    .sr-post-row-time { grid-column: 2; display: none; }
    .sr-output-band { grid-template-columns: 1fr 1fr; }
    .sr-output-band > a { min-height: 96px; }
    .sr-output-band > a:nth-child(3), .sr-output-band > a:nth-child(5) { border-right: 0; }
    .sr-output-band > a:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
    .sr-newsletter { padding: 38px 22px; gap: 26px; }
    .sr-newsletter h2 { font-size: 23px; }
    .sr-signup-form { grid-template-columns: 1fr; gap: 8px; }
    .sr-signup-form input, .sr-signup-form button { border: 1px solid #5e6a6d; border-radius: 5px; }
    .sr-signup-form button { border-color: var(--accent); }
    .sr-page-hero > div:first-child, .sr-about-copy, .sr-project-hero-copy { padding: 48px 24px 42px; }
    .sr-page-hero h1, .sr-about-copy h1, .sr-project-hero-copy h1 { font-size: 40px; }
    .sr-page-hero p, .sr-about-copy p, .sr-project-hero-copy p { font-size: 18px; }
    .sr-buffer-index { padding: 18px 22px; }
    .sr-page-content-shell { padding: 46px 24px 62px; }
    .sr-writing-archive { padding: 8px 20px 30px; }
    .sr-filter-tags { padding: 16px 20px; }
    .sr-post-header-inner { padding: 46px 22px 32px; }
    .sr-post-header h1 { font-size: clamp(34px, 11vw, 48px); }
    .sr-post-deck { font-size: 18px; }
    .sr-post-feature { padding: 0 12px 30px; }
    .sr-article-shell { grid-template-columns: minmax(0, 1fr); gap: 28px; padding: 44px 24px 58px; }
    .sr-toc nav { columns: 1; }
    .gh-content, .sr-prose { font-size: 18px; line-height: 1.68; }
    .gh-content h2 { font-size: 25px; }
    .gh-content h3 { font-size: 20px; }
    .gh-content h2::before, .gh-content h3::before { display: none; }
    .gh-content .kg-width-wide, .gh-content .kg-width-full { width: calc(100vw - 18px); max-width: calc(100vw - 18px); }
    .sr-post-footer { padding: 32px 22px 48px; }
    .sr-post-nav { grid-template-columns: 1fr; }
    .sr-post-nav a + a { border-left: 0; border-top: 1px solid var(--line); text-align: left; }
    .sr-footer { width: calc(100% - 16px); }
    .sr-footer-inner { grid-template-columns: 1fr; padding: 32px 22px; }
    .sr-footer-inner > nav:last-child { grid-column: auto; }
    .sr-footer-bottom { flex-direction: column; padding: 13px 22px; }
    .sr-mode-line { height: 31px; }
    .sr-mode-line > span { padding: 0 8px; }
    .sr-mode-hide-small, .sr-mode-line [data-sr-clock] { display: none; }
    .sr-command { grid-template-columns: 1fr auto; }
    .sr-command span { grid-column: 1 / -1; }
    #ghost-comments-root { padding-left: 22px; padding-right: 22px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .001ms !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; }
}
