:root {
  --blue: #2a6aff;
  --blue-deep: #143fa3;
  --ink: #0b1020;
  --muted: #4a5468;
  --muted-2: #3a4458;
  --line: #e3e7ef;
  --surface: #f3f5fa;
  --tint: #e8efff;
  --white: #ffffff;
  --live: #b42318;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --wrap: 1280px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--white); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.5; }
img { max-width: 100%; display: block; }
a { color: var(--blue-deep); text-decoration: none; }
a:hover { color: var(--blue); text-decoration: underline; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.mono { font-family: var(--mono); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; background: var(--ink); color: var(--white); padding: 8px 12px; z-index: 10; }

/* Top bar and header */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); font: 500 12px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.topbar .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding-top: 9px; padding-bottom: 9px; }
.topbar a { font-weight: 600; }
.site-header { border-bottom: 1px solid var(--line); background: var(--white); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; padding-top: 14px; padding-bottom: 14px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand:hover { text-decoration: none; }
.brand img { height: 38px; width: auto; }
.brand .tag { font: 600 12px/1 var(--mono); letter-spacing: .12em; color: var(--white); background: var(--ink); padding: 5px 8px; border-radius: 4px; }
.nav { display: flex; flex-wrap: wrap; gap: 0 22px; flex: 1 1 380px; justify-content: center; font-weight: 600; font-size: 15px; }
.nav a { color: var(--ink); padding: 10px 0; border-bottom: 2px solid transparent; }
.nav a[aria-current="page"] { color: var(--blue-deep); border-bottom-color: var(--blue); }
.nav a:hover { color: var(--blue); text-decoration: none; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; border-radius: 999px; font: 700 15px/1 var(--sans); border: 0; cursor: pointer; text-decoration: none; }
.btn:hover { text-decoration: none; }
.btn-blue { background: var(--blue); color: var(--white); }
.btn-blue:hover { background: var(--blue-deep); color: var(--white); }
.btn-dark { background: var(--ink); color: var(--white); }
.btn-dark:hover { color: var(--white); background: #1d2540; }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn-ghost-light { background: transparent; color: var(--white); border: 1px solid #3a4766; }
.btn-ghost-light:hover { color: var(--white); border-color: #8fb0ff; }

/* Live wire */
.wire { border-bottom: 1px solid var(--line); }
.wire .wire-row { display: flex; align-items: center; gap: 20px; padding-top: 11px; padding-bottom: 11px; font-size: 14px; }
.wire-label { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; font: 600 12px/1 var(--mono); letter-spacing: .1em; color: var(--live); }
.wire-dot { width: 8px; height: 8px; border-radius: 4px; background: #d92d20; }
.wire a { color: var(--ink); display: inline-flex; gap: 8px; white-space: nowrap; padding-right: 36px; }
.wire time { font-family: var(--mono); color: var(--muted); }
.wire-dot { animation: pulse 1.6s ease-in-out infinite; }
.ticker { flex: 1 1 auto; min-width: 0; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 24px, #000 calc(100% - 24px), transparent); mask-image: linear-gradient(90deg, transparent, #000 24px, #000 calc(100% - 24px), transparent); }
.ticker-track { display: flex; width: max-content; animation: ticker var(--ticker-duration, 60s) linear infinite; }
.ticker-group { display: flex; flex: 0 0 auto; }
.ticker:hover .ticker-track, .ticker:focus-within .ticker-track { animation-play-state: paused; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) {
  .ticker-track, .wire-dot { animation: none; }
  .ticker { overflow-x: auto; -webkit-mask-image: none; mask-image: none; }
  .ticker-group[aria-hidden="true"] { display: none; }
}

/* Chips */
.chip { display: inline-block; font: 600 12px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; padding: 5px 9px; border-radius: 6px; background: var(--tint); color: var(--blue-deep); }
.chip-solid { background: var(--blue); color: var(--white); }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.eyebrow { font: 600 12px/1.3 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--blue-deep); margin: 0; }

/* Home */
main { display: block; }
.home { padding-top: 32px; padding-bottom: 64px; display: flex; flex-direction: column; gap: 40px; }
.top { display: flex; flex-wrap: wrap; gap: 24px; }
.lead { flex: 999 1 560px; min-width: 0; position: relative; border-radius: 20px; overflow: hidden; min-height: 460px; display: flex; color: var(--white); }
.lead:hover { text-decoration: none; color: var(--white); }
.lead > img, .lead .pattern { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.lead .shade { position: absolute; inset: 0; background: rgba(8, 14, 36, .78); }
.lead .body { position: relative; padding: 40px; display: flex; flex-direction: column; justify-content: flex-end; gap: 16px; max-width: 720px; }
.lead h1, .lead h2 { margin: 0; font: 700 clamp(32px, 4.8vw, 58px)/1.05 var(--serif); letter-spacing: -.01em; color: var(--white); }
.lead p { margin: 0; font-size: 18px; line-height: 1.55; color: #e4e9f6; }
.lead .meta { color: #d6ddf0; }
.lead:hover h2 { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.byline-mini { display: flex; align-items: center; gap: 10px; font-size: 14px; color: #e4e9f6; }
.byline-mini img { width: 36px; height: 36px; border-radius: 18px; object-fit: cover; border: 2px solid var(--white); }
.side { flex: 1 1 340px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.card { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; color: var(--ink); background: var(--white); }
.card:hover { text-decoration: none; color: var(--ink); border-color: #c9d6f5; }
.card:hover h2, .card:hover h3 { color: var(--blue-deep); }
.card .media { height: 150px; position: relative; overflow: hidden; background: var(--blue-deep); }
.card .media img { width: 100%; height: 100%; object-fit: cover; }
.card .body { padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.card h2 { margin: 0; font: 700 23px/1.18 var(--serif); }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }
.row-card { border: 1px solid var(--line); border-radius: 16px; padding: 20px; display: flex; gap: 16px; color: var(--ink); }
.row-card:hover { text-decoration: none; color: var(--ink); border-color: #c9d6f5; }
.row-card:hover h3 { color: var(--blue-deep); }
.row-card .text { flex: 1 1 auto; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.row-card h3 { margin: 0; font: 700 21px/1.2 var(--serif); }
.row-card p { margin: 0; font-size: 14px; line-height: 1.55; color: var(--muted); }
.row-card .thumb { flex: 0 0 104px; height: 104px; border-radius: 12px; overflow: hidden; background: var(--blue-deep); }
.row-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.lower { display: flex; flex-wrap: wrap; gap: 32px; border-top: 1px solid var(--line); padding-top: 32px; }
.latest { flex: 3 1 420px; min-width: 0; }
.latest-head { display: flex; justify-content: space-between; align-items: baseline; padding-bottom: 6px; }
.latest-head h2 { margin: 0; font: 700 30px/1.2 var(--serif); }
.list-item { display: flex; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); color: var(--ink); }
.list-item:hover { text-decoration: none; color: var(--ink); }
.list-item:hover .t { color: var(--blue-deep); }
.list-item time { font: 500 13px/1.6 var(--mono); color: var(--muted); flex: 0 0 52px; }
.list-item .k { font: 600 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--blue-deep); }
.list-item .t { font: 600 19px/1.3 var(--serif); }
.list-item .stack { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.rail { flex: 2 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.take-card { background: var(--ink); color: var(--white); border-radius: 20px; padding: 28px; display: flex; flex-direction: column; gap: 16px; }
.take-card .eyebrow { color: #8fb0ff; }
.take-card blockquote { margin: 0; font: 600 23px/1.32 var(--serif); }
.take-card .who { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.take-card .who img { width: 44px; height: 44px; border-radius: 22px; object-fit: cover; }
.take-card .who a { color: #8fb0ff; }
.feed-status { text-align: center; padding: 20px 0; color: var(--muted); font-size: 14px; }
.feed-status:empty { padding: 0; }
.empty { border: 1px dashed var(--line); border-radius: 16px; padding: 40px; text-align: center; color: var(--muted); }

/* Section pages */
.section-head { padding: 36px 0 8px; display: flex; flex-direction: column; gap: 8px; }
.section-head h1 { margin: 0; font: 700 clamp(34px, 5vw, 52px)/1.05 var(--serif); }
.section-head p { margin: 0; color: var(--muted); font-size: 17px; max-width: 680px; }
.pager { display: flex; justify-content: space-between; gap: 12px; padding: 24px 0 64px; }

/* Post */
.post-wrap { padding-top: 32px; padding-bottom: 64px; display: flex; flex-wrap: wrap; gap: 48px; }
.article { flex: 999 1 600px; min-width: 0; max-width: 780px; display: flex; flex-direction: column; gap: 24px; }
.crumbs { font: 500 12px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.crumbs a { color: var(--muted); }
.article h1 { margin: 0; font: 700 clamp(32px, 4.6vw, 52px)/1.07 var(--serif); letter-spacing: -.01em; }
.article .dek { margin: 0; font-size: 20px; line-height: 1.55; color: var(--muted-2); }
.byline { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.byline .who { display: flex; align-items: center; gap: 12px; }
.byline img { width: 48px; height: 48px; border-radius: 24px; object-fit: cover; }
.byline .name { font-size: 14px; }
.byline .when { font: 500 12px/1.5 var(--mono); color: var(--muted); }
.share { display: flex; gap: 8px; }
.icon-btn { width: 44px; height: 44px; border-radius: 22px; border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; background: var(--white); color: var(--ink); cursor: pointer; }
.figure { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.figure .frame { position: relative; border-radius: 16px; overflow: hidden; aspect-ratio: 16 / 9; background: var(--blue-deep); }
.figure .frame img { width: 100%; height: 100%; object-fit: cover; }
.figure figcaption { font-size: 13px; color: var(--muted); }
.facts h2, .case h2 { margin: 0; }
.facts ul { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 10px; font: 400 19px/1.6 var(--serif); }
.case { background: var(--ink); color: var(--white); border-radius: 20px; padding: 32px; display: flex; flex-direction: column; gap: 22px; }
.case .top-line { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.case .eyebrow { color: #8fb0ff; }
.case h3 { margin: 0 0 8px; font-size: 15px; font-weight: 700; }
.case .why p { margin: 0; font: 400 19px/1.6 var(--serif); color: #e4e9f6; }
.case .angles { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.case .angle { border: 1px solid #2a3550; border-radius: 14px; padding: 20px; }
.case .angle h3 { font: 600 12px/1.3 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: #8fb0ff; }
.case .angle p { margin: 0; font-size: 16px; line-height: 1.6; color: #e4e9f6; }
.case .nfa { margin: 0; font-size: 13px; color: #9aa6c2; }
.source-card { border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.source-card .label { font: 500 12px/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.source-card .name { font-weight: 700; }
.disclosure { margin: 0; font-size: 13px; line-height: 1.6; color: var(--muted); }
.author { background: var(--surface); border-radius: 20px; padding: 24px; display: flex; flex-wrap: wrap; gap: 20px; align-items: center; }
.author img { width: 88px; height: 88px; border-radius: 44px; object-fit: cover; }
.author .text { flex: 1 1 300px; display: flex; flex-direction: column; gap: 6px; }
.author h2 { margin: 0; font-size: 18px; }
.author p { margin: 0; font-size: 15px; line-height: 1.6; color: var(--muted-2); }
.aside { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.aside h2 { margin: 0 0 6px; font: 700 24px/1.2 var(--serif); }
.aside .list-item { flex-direction: column; gap: 4px; }

/* Static pages */
.page { padding-top: 40px; padding-bottom: 72px; max-width: 760px; }
.page h1 { margin: 0 0 20px; font: 700 clamp(34px, 5vw, 52px)/1.08 var(--serif); }
.page h2 { margin: 36px 0 10px; font: 700 26px/1.2 var(--serif); scroll-margin-top: 16px; }
.page p, .page li { font: 400 19px/1.65 var(--serif); color: #1c2333; }
.page ul { padding-left: 22px; }
.page .lede { font-size: 22px; color: var(--muted-2); }
.page .portrait { display: flex; flex-wrap: wrap; gap: 24px; align-items: center; margin: 8px 0 24px; }
.page .portrait img { width: 160px; height: 160px; border-radius: 80px; object-fit: cover; }

/* Footer */
.site-footer { background: var(--ink); color: #c9d2e6; }
.footer-grid { padding-top: 56px; padding-bottom: 48px; display: grid; grid-template-columns: minmax(260px, 1.6fr) repeat(3, minmax(140px, 1fr)); gap: 40px 32px; }
.f-brand { display: flex; flex-direction: column; gap: 16px; }
.f-brand img { height: 38px; width: auto; align-self: flex-start; }
.f-brand p { margin: 0; font-size: 15px; line-height: 1.6; max-width: 320px; }
.socials { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.social { width: 44px; height: 44px; border-radius: 22px; border: 1px solid #3a4766; display: inline-flex; align-items: center; justify-content: center; color: var(--white); }
.social:hover { border-color: #8fb0ff; color: var(--white); }
.f-follow { color: var(--white); font-weight: 600; font-size: 14px; }
.f-col { display: flex; flex-direction: column; gap: 12px; font-size: 15px; }
.f-col h2 { margin: 0 0 4px; font: 600 12px/1.3 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: #8fb0ff; }
.f-col a { color: var(--white); font-weight: 600; }
.f-col a:hover, .f-follow:hover { color: #8fb0ff; }
.site-footer .legal { border-top: 1px solid #222b42; }
.site-footer .legal .wrap { padding-top: 18px; padding-bottom: 18px; font-size: 13px; color: #9aa6c2; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.site-footer .legal nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.site-footer .legal a { color: #c9d2e6; }

/* Admin */
.admin { padding-top: 28px; padding-bottom: 64px; display: flex; flex-direction: column; gap: 24px; }
.admin h1 { margin: 0; font: 700 32px/1.2 var(--serif); }
.admin h2 { margin: 0; font: 700 22px/1.2 var(--serif); }
.panel { border: 1px solid var(--line); border-radius: 16px; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.panel.row { flex-direction: row; flex-wrap: wrap; align-items: center; }
.q-item { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; display: flex; flex-wrap: wrap; }
.q-item .q-photo { flex: 0 0 220px; min-height: 160px; background: var(--blue-deep); }
.q-item .q-photo img { width: 100%; height: 100%; object-fit: cover; }
.q-item .q-body { flex: 1 1 360px; padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.q-item h3 { margin: 0; font: 700 21px/1.25 var(--serif); }
.flag { display: inline-block; font: 600 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .06em; padding: 5px 8px; border-radius: 6px; background: #fff1e6; color: #9a3412; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.actions form { margin: 0; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 700; font-size: 14px; }
.field input, .field textarea, .field select { font: 400 16px/1.5 var(--sans); padding: 10px 12px; border: 1px solid #c4cbd8; border-radius: 10px; width: 100%; }
.field textarea { min-height: 90px; resize: vertical; }
.notice { padding: 12px 16px; border-radius: 12px; background: var(--tint); color: var(--blue-deep); font-weight: 600; }
.notice.bad { background: #fef3f2; color: #b42318; }
table.runs { width: 100%; border-collapse: collapse; font-size: 14px; }
table.runs th, table.runs td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table-box { overflow-x: auto; }
.ok { color: #067647; font-weight: 700; }
.bad { color: #b42318; font-weight: 700; }

@media (max-width: 900px) {
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .f-brand { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .site-header .btn { display: none; }
  .nav { flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; gap: 0 18px; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { white-space: nowrap; }
  .wire .wire-row { gap: 12px; }
  .lead { min-height: 400px; }
  .lead .body { padding: 24px; }
  .row-card .thumb { flex-basis: 84px; height: 84px; }
  .case { padding: 22px; }
  .q-item .q-photo { flex-basis: 100%; height: 180px; }
  .footer-grid { padding-top: 40px; padding-bottom: 36px; }
}
