:root {
  --navy: #0c3c82;
  --navy-deep: #082a5e;
  --blue: #3a86d0;
  --sky: #5b9fe1;
  --ice: #e3effc;
  --ink: #0b1f3a;
  --body: #243650;
  --muted: #5b6b82;
  --line: #dfe7f1;
  --bg: #f4f7fb;
  --card: #ffffff;
  --danger: #b42318;
  --ok: #067647;
  --linkedin: #0a66c2;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(11, 31, 58, 0.06), 0 8px 24px rgba(11, 31, 58, 0.06);
  --display: 'Montserrat', 'Segoe UI', system-ui, sans-serif;
  --text: 'Inter', 'Segoe UI', system-ui, sans-serif;
  --serif: 'Source Serif 4', Georgia, serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 var(--text); }
a { color: var(--blue); }
a:hover { color: var(--navy); }
img, svg { max-width: 100%; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Header ---------- */
.site-header { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--navy); }
.logo-mark { width: 34px; height: 34px; flex: none; }
.wordmark-sm { font: 800 19px/1 var(--display); letter-spacing: 0.3px; }
.wordmark-sm small { display: block; font: 600 9px/1 var(--display); letter-spacing: 3.2px; color: var(--blue); margin-top: 4px; }
.nav { display: flex; align-items: center; gap: 6px; }
.nav a, .nav button.linklike { color: var(--body); text-decoration: none; font-weight: 600; font-size: 15px; padding: 8px 12px; border-radius: 8px; }
.nav a:hover, .nav button.linklike:hover { background: var(--ice); color: var(--navy); }
.nav form { margin: 0; }
button.linklike { background: none; border: 0; cursor: pointer; font: inherit; }
@media (max-width: 640px) {
  .nav .hide-sm { display: none; }
  .nav a, .nav button.linklike { padding: 8px 8px; font-size: 14px; }
}

/* ---------- Buttons & forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 700 15px/1 var(--text); padding: 12px 20px; border-radius: 10px; border: 1px solid transparent; cursor: pointer; text-decoration: none; background: var(--blue); color: #fff; }
.btn:hover { background: var(--navy); color: #fff; }
.btn-light { background: #fff; color: var(--navy); }
.btn-light:hover { background: var(--ice); color: var(--navy); }
.btn-outline { background: #fff; color: var(--navy); border-color: var(--line); }
.btn-outline:hover { background: var(--ice); color: var(--navy); }
.btn-linkedin { background: var(--linkedin); color: #fff; width: 100%; }
.btn-linkedin:hover { background: #004182; }
.btn-danger { background: #fff; color: var(--danger); border-color: #f1c4bf; }
.btn-danger:hover { background: #fef3f2; color: var(--danger); }
.btn-sm { padding: 8px 12px; font-size: 13px; border-radius: 8px; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
label { display: block; font-weight: 600; font-size: 14px; margin: 14px 0 6px; color: var(--ink); }
input[type=text], input[type=email], input[type=password], input[type=datetime-local], textarea {
  width: 100%; font: 16px/1.5 var(--text); padding: 11px 13px; border: 1px solid #c9d5e4; border-radius: 10px; background: #fff; color: var(--ink);
}
textarea { min-height: 120px; resize: vertical; }
textarea.code { font: 13px/1.5 ui-monospace, Consolas, monospace; min-height: 380px; }
input:focus, textarea:focus { outline: 3px solid rgba(58, 134, 208, 0.25); border-color: var(--blue); }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: 14px; color: var(--body); margin: 14px 0; }
.check input { margin-top: 4px; width: 16px; height: 16px; flex: none; }
.hint { font-size: 13px; color: var(--muted); margin: 6px 0 0; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; margin: 20px 0; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* ---------- Notices ---------- */
.notice { border-radius: 10px; padding: 12px 16px; margin: 16px 0; font-size: 15px; border: 1px solid; }
.notice-info { background: var(--ice); border-color: #c4dcf6; color: var(--navy); }
.notice-ok { background: #ecfdf3; border-color: #abefc6; color: var(--ok); }
.notice-error { background: #fef3f2; border-color: #fecdca; color: var(--danger); }

/* ---------- Hero ---------- */
.announce { background: #ffd166; color: var(--ink); font-size: 15px; text-align: center; }
.announce .wrap { padding: 10px 20px; display: flex; gap: 6px 14px; justify-content: center; align-items: center; flex-wrap: wrap; }
.announce a { color: var(--navy); font-weight: 700; white-space: nowrap; }
.hero { position: relative; overflow: hidden; background: var(--navy); color: #fff; min-height: 420px; display: flex; align-items: center; }
.hero-art { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-inner { position: relative; text-align: center; padding: 64px 20px; width: 100%; }
.hero h1 { font: 800 clamp(44px, 8vw, 92px)/1 var(--display); letter-spacing: 1px; margin: 0; text-shadow: 0 2px 24px rgba(8, 42, 94, 0.45); }
.hero .kicker { font: 600 clamp(12px, 1.8vw, 18px)/1 var(--display); letter-spacing: 0.55em; margin: 16px 0 0; color: #cfe3fa; padding-left: 0.55em; }
.hero .tagline { max-width: 560px; margin: 22px auto 28px; font-size: 18px; color: #e6f0fc; }
.hero .actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
@media (max-width: 1000px) { .hero-art { opacity: 0.65; } }
@media (max-width: 760px) {
  .hero { min-height: 380px; }
  .hero-brain { display: none; }
}

/* ---------- Cards ---------- */
.section { padding: 48px 0; }
.section h2.section-title { font: 800 26px/1.2 var(--display); color: var(--navy); margin: 0 0 20px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; text-decoration: none; color: inherit; transition: transform 0.15s ease, box-shadow 0.15s ease; }
a.card:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(11, 31, 58, 0.08), 0 14px 32px rgba(11, 31, 58, 0.1); color: inherit; }
.cover { display: block; width: 100%; height: auto; }
.card-body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.meta { font-size: 13px; color: var(--muted); font-weight: 600; letter-spacing: 0.2px; }
.card h3 { font: 700 19px/1.35 var(--display); margin: 0; color: var(--ink); }
.card p { margin: 0; color: var(--body); font-size: 15px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.featured { display: grid; grid-template-columns: 1.1fr 1fr; }
.featured .card-body { padding: 28px; justify-content: center; }
.featured h3 { font-size: 26px; }
.featured p { -webkit-line-clamp: 5; font-size: 16px; }
@media (max-width: 820px) { .featured { grid-template-columns: 1fr; } .featured h3 { font-size: 22px; } }
.empty { background: #fff; border: 1px dashed #c9d5e4; border-radius: var(--radius); padding: 32px; text-align: center; color: var(--muted); }

/* ---------- Subscribe band ---------- */
.subscribe-band { background: linear-gradient(120deg, var(--navy), #174f9c); color: #fff; border-radius: 18px; padding: 32px; display: grid; grid-template-columns: 1.2fr 1fr; gap: 24px; align-items: center; }
.subscribe-band h2 { font: 800 26px/1.2 var(--display); margin: 0 0 8px; }
.subscribe-band p { margin: 0; color: #d9e8fa; }
.subscribe-form { display: flex; gap: 10px; flex-wrap: wrap; }
.subscribe-form input[type=email] { flex: 1; min-width: 200px; border-color: transparent; }
.subscribe-band .fine { font-size: 12px; color: #b9d2ef; margin-top: 10px; }
.subscribe-band .fine a { color: #fff; }
@media (max-width: 760px) { .subscribe-band { grid-template-columns: 1fr; padding: 24px; } }

/* ---------- Article ---------- */
.article-cover { background: var(--navy); }
.article-cover .cover { max-width: 1120px; margin: 0 auto; }
.article-head { padding: 36px 0 8px; }
.article-head .eyebrow { font: 700 13px/1 var(--display); letter-spacing: 2px; color: var(--blue); text-transform: uppercase; }
.article-head h1 { font: 800 clamp(30px, 4.6vw, 44px)/1.15 var(--display); color: var(--ink); margin: 12px 0 14px; }
.byline { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 14px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--ice); color: var(--navy); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; flex: none; object-fit: cover; }
.avatar.sm { width: 32px; height: 32px; font-size: 13px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin: 22px 0; }
.panel h2 { font: 800 13px/1 var(--display); letter-spacing: 2px; text-transform: uppercase; color: var(--blue); margin: 0 0 10px; }
.panel p { margin: 0; }
.panel.note { background: var(--ice); border-color: #c9dff6; color: var(--navy); font-size: 15px; font-style: italic; }
.prose { font: 19px/1.75 var(--serif); color: var(--body); }
.prose h2 { font: 800 26px/1.25 var(--display); color: var(--ink); margin: 44px 0 12px; }
.prose h3 { font: 700 21px/1.3 var(--display); color: var(--ink); margin: 32px 0 10px; }
.prose p { margin: 0 0 20px; }
.prose ul, .prose ol { padding-left: 24px; margin: 0 0 22px; }
.prose li { margin: 0 0 10px; }
.prose b, .prose strong { color: var(--ink); }
.prose a { word-break: break-word; }
.sources { font-size: 14px; }
.sources ol { padding-left: 20px; margin: 0; }
.sources li { margin: 6px 0; word-break: break-all; }
.share-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 28px 0; }
.draft-banner { background: #fffaeb; border-bottom: 1px solid #fedf89; color: #93370d; font-weight: 600; text-align: center; padding: 10px; font-size: 14px; }

/* ---------- Comments ---------- */
.comments { margin: 44px 0 64px; }
.comments h2 { font: 800 22px/1.2 var(--display); color: var(--ink); margin: 0 0 16px; }
.comment { display: flex; gap: 12px; padding: 16px 0; border-top: 1px solid var(--line); }
.comment .who { font-weight: 700; font-size: 15px; }
.comment .when { color: var(--muted); font-size: 13px; margin-left: 8px; font-weight: 400; }
.comment .text { white-space: pre-wrap; margin-top: 4px; color: var(--body); overflow-wrap: anywhere; }
.comment .actions { margin-top: 6px; display: flex; gap: 10px; }
.comment .actions button { background: none; border: 0; color: var(--muted); font-size: 13px; cursor: pointer; padding: 0; }
.comment .actions button:hover { color: var(--danger); }
.comment.hidden-comment { opacity: 0.55; }
.signin-prompt { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }

/* ---------- Auth pages ---------- */
.auth-card { max-width: 440px; margin: 48px auto; background: #fff; border-radius: 18px; box-shadow: var(--shadow); padding: 32px; }
.auth-card h1 { font: 800 26px/1.2 var(--display); color: var(--navy); margin: 0 0 6px; }
.auth-card .sub { color: var(--muted); margin: 0 0 20px; font-size: 15px; }
.auth-card .btn[type=submit] { width: 100%; margin-top: 18px; }
.auth-foot { text-align: center; font-size: 14px; color: var(--muted); margin-top: 18px; }

/* ---------- Admin ---------- */
.admin h1 { font: 800 28px/1.2 var(--display); color: var(--navy); margin: 32px 0 8px; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin: 20px 0; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.stat .n { font: 800 28px/1 var(--display); color: var(--navy); }
.stat .l { font-size: 13px; color: var(--muted); margin-top: 6px; }
table.list { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); font-size: 14px; }
table.list th, table.list td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list th { background: #f8fafd; font-size: 12px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--muted); }
.table-scroll { overflow-x: auto; }
.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.pill-draft { background: #fff4e5; color: #93370d; }
.pill-scheduled { background: var(--ice); color: var(--navy); }
.pill-published { background: #ecfdf3; color: var(--ok); }
.admin-grid { display: grid; grid-template-columns: 1fr 320px; gap: 24px; align-items: start; }
.admin-side { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 16px; }
.admin-side .panel { margin: 0; }
.admin-side form { margin: 0; }
.admin-side .btn { width: 100%; }
@media (max-width: 900px) { .admin-grid { grid-template-columns: 1fr; } .admin-side { position: static; } }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy-deep); color: #b9d2ef; padding: 36px 0; font-size: 14px; margin-top: 40px; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.site-footer a { color: #fff; text-decoration: none; margin-right: 16px; }
.site-footer a:hover { text-decoration: underline; color: #fff; }
.site-footer .disclaimer { max-width: 520px; color: #9fbde3; font-size: 13px; }

/* ---------- Archive ---------- */
.archive-year h2 { font: 800 22px/1 var(--display); color: var(--blue); margin: 36px 0 8px; }
.archive-list { list-style: none; margin: 0; padding: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.archive-list li + li { border-top: 1px solid var(--line); }
.archive-list a { display: flex; gap: 16px; align-items: baseline; padding: 14px 18px; text-decoration: none; color: var(--ink); }
.archive-list a:hover { background: var(--ice); color: var(--navy); }
.archive-meta { flex: none; width: 150px; font-size: 13px; font-weight: 600; color: var(--muted); }
.archive-title { font-weight: 600; line-height: 1.4; }
@media (max-width: 560px) { .archive-list a { flex-direction: column; gap: 2px; } .archive-meta { width: auto; } }

/* ---------- Password eye, name row, social sign-in ---------- */
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 46px; }
.pw-eye { position: absolute; top: 50%; right: 6px; transform: translateY(-50%); width: 36px; height: 36px; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.pw-eye:hover { background: var(--ice); color: var(--navy); }
.pw-eye .eye-off { display: none; }
.pw-eye.on .eye { display: none; }
.pw-eye.on .eye-off { display: inline; }
.name-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 420px) { .name-row { grid-template-columns: 1fr; } }
.social-buttons { display: flex; flex-direction: column; gap: 10px; }
.btn-google { background: #fff; color: var(--ink); border-color: #c9d5e4; width: 100%; }
.btn-google:hover { background: #f5f8fc; color: var(--ink); }

/* ---------- Admin stats ---------- */
.stats { --viz-1: #2a78d6; --viz-grid: #e4eaf2; --viz-axis: #c3cede; }
.stats .panel { margin: 16px 0; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin: 16px 0; }
.stats-grid .panel { margin: 0; min-width: 0; }
.stats-h { font: 800 20px/1.3 var(--display); color: var(--ink); margin: 32px 0 12px; }
.stats-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 32px 0 12px; }
.stats-head .stats-h { margin: 0; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; margin-top: 4px; }
.seg a { padding: 8px 14px; font-size: 14px; font-weight: 600; color: var(--body); text-decoration: none; border-right: 1px solid var(--line); }
.seg a:last-child { border-right: 0; }
.seg a[aria-current='page'] { background: var(--navy); color: #fff; }
.stat .delta { font-size: 12px; margin-top: 6px; color: var(--muted); }
.stat .delta.up { color: var(--ok); }
.stat .delta.down { color: var(--danger); }
table.list th.num, table.list td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pill-muted { background: #eef1f5; color: var(--muted); }

.chart { margin: 0; }
.chart figcaption { font: 800 13px/1 var(--display); letter-spacing: 2px; text-transform: uppercase; color: var(--blue); margin: 0 0 18px; }
.chart-grid { display: grid; grid-template-columns: 40px minmax(0, 1fr); grid-template-rows: 200px 24px; }
.chart .y-ticks { position: relative; }
.chart .y-ticks span { position: absolute; right: 8px; transform: translateY(-50%); font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.chart .plot { position: relative; outline: none; cursor: crosshair; }
.chart .plot:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; border-radius: 4px; }
.chart .plot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.chart .grid { stroke: var(--viz-grid); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart .base { stroke: var(--viz-axis); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart .line { fill: none; stroke: var(--viz-1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.chart .area { fill: var(--viz-1); opacity: 0.1; }
.chart .hair { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--viz-axis); pointer-events: none; }
.chart .dot { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--viz-1); box-shadow: 0 0 0 2px #fff; pointer-events: none; }
.chart-tip { position: absolute; transform: translateX(-50%); background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); padding: 8px 10px; font-size: 13px; line-height: 1.45; pointer-events: none; white-space: nowrap; color: var(--body); z-index: 2; }
.chart-tip .d { color: var(--muted); font-size: 12px; }
.chart-tip strong { color: var(--ink); }
.chart .x-ticks { position: relative; grid-column: 2; }
.chart .x-ticks span { position: absolute; top: 8px; transform: translateX(-50%); font-size: 11px; color: var(--muted); white-space: nowrap; }
.chart .x-ticks span.end { transform: translateX(-100%); }
.chart details { margin-top: 12px; font-size: 13px; }
.chart details summary { cursor: pointer; color: var(--muted); }
.chart details table { margin-top: 8px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.chart details th, .chart details td { text-align: right; padding: 4px 0 4px 24px; }
.chart details th:first-child, .chart details td:first-child { text-align: left; padding-left: 0; }
.chart details th { font-size: 12px; color: var(--muted); font-weight: 600; }

.barlist { display: grid; gap: 12px; }
.barlist .row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: baseline; font-size: 14px; }
.barlist .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--body); }
.barlist .lbl a { color: inherit; text-decoration: none; }
.barlist .lbl a:hover { text-decoration: underline; }
.barlist .val { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink); }
.barlist .bar { grid-column: 1 / -1; height: 8px; border-radius: 0 4px 4px 0; background: var(--viz-1); }
.barlist .row:hover .bar { filter: brightness(1.15); }
