/* Simply Explained by Suraj: shared design system (Dec 2026 rebuild).
   Loaded last on every page so the header, footer and type are the same everywhere. */
:root {
  --ink: #13233a;        /* SafeGrade navy: text, header, letter band */
  --paper: #f3f5f4;      /* cool page ground */
  --card: #ffffff;
  --amber: #f0b23c;      /* the warning colour: fills only, never small text on white */
  --amber-deep: #8a5a00; /* amber that passes contrast as text */
  --slate: #4b5b6d;      /* secondary text */
  --rule: #d6dce2;
  --link: #1c4f8a;
  --serif: "Newsreader", Georgia, serif;
  --sans: "Atkinson Hyperlegible", "Atkinson Hyperlegible Next", system-ui, sans-serif;
}

/* ---------- shared base (applies to legacy pages too) ---------- */
body { font-family: var(--sans) !important; }
.view-counter, [data-view-counter][data-kind="views"] { display: none !important; }
.masthead { display: none !important; } /* legacy header, replaced by .sx-header */
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }

/* ---------- header ---------- */
.sx-header { background: var(--ink); color: #fff; position: sticky; top: 0; z-index: 50; }
.sx-header-in { max-width: 1180px; margin: 0 auto; padding: 14px 24px; display: flex; align-items: center; gap: 28px; }
.sx-brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; flex-shrink: 0; }
.sx-brand img { width: 38px; height: 38px; border-radius: 8px; }
.sx-brand b { font-family: var(--serif); font-weight: 600; font-size: 21px; line-height: 1.1; display: block; }
.sx-brand small { font-family: var(--sans); font-size: 13px; color: #b8c4d3; display: block; }
.sx-nav { display: flex; gap: 4px; margin-left: auto; align-items: center; flex-wrap: wrap; }
.sx-nav a { color: #dfe6ee; text-decoration: none; font: 500 15.5px/1 var(--sans); padding: 10px 11px; border-radius: 6px; }
.sx-nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.sx-nav a[aria-current="page"] { color: #fff; box-shadow: inset 0 -3px 0 var(--amber); border-radius: 0; }
.sx-nav a.sx-sub { background: var(--amber); color: var(--ink); font-weight: 700; margin-left: 8px; border-radius: 6px; }
.sx-nav a.sx-sub:hover { background: #f6c560; }
.sx-menu { display: none; margin-left: auto; background: none; border: 1px solid rgba(255,255,255,.35); color: #fff;
  font: 600 15px var(--sans); padding: 9px 14px; border-radius: 6px; cursor: pointer; }
@media (max-width: 980px) {
  .sx-menu { display: block; }
  .sx-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--ink);
    flex-direction: column; align-items: stretch; padding: 8px 16px 18px; border-top: 1px solid rgba(255,255,255,.1); }
  .sx-header.open .sx-nav { display: flex; }
  .sx-nav a { padding: 14px 10px; font-size: 17px; }
  .sx-nav a.sx-sub { margin: 8px 0 0; text-align: center; }
  .sx-nav a[aria-current="page"] { box-shadow: inset 4px 0 0 var(--amber); }
}

/* ---------- footer ---------- */
.sx-footer { background: var(--ink); color: #c9d3de; margin-top: 80px; }
.sx-footer-in { max-width: 1180px; margin: 0 auto; padding: 48px 24px 36px; display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; }
.sx-footer h2 { font: 600 22px/1.2 var(--serif); color: #fff; margin: 0 0 10px; }
.sx-footer h3 { font: 700 15px var(--sans); color: #fff; margin: 0 0 12px; }
.sx-footer p { margin: 0 0 10px; font-size: 15.5px; line-height: 1.55; }
.sx-footer ul { list-style: none; margin: 0; padding: 0; }
.sx-footer li { margin: 0 0 8px; }
.sx-footer a { color: #fff; text-decoration-color: rgba(255,255,255,.35); text-underline-offset: 3px; }
.sx-footer .sx-legal { grid-column: 1 / -1; border-top: 1px solid rgba(255,255,255,.12); padding-top: 18px; font-size: 14px; color: #9fb0c2; }
@media (max-width: 760px) { .sx-footer-in { grid-template-columns: 1fr; gap: 28px; } }

/* review fixes */
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; box-shadow: 0 0 0 6px #fff; }
.sx-header :focus-visible, .sx-intro :focus-visible, .sx-letter :focus-visible, .sx-footer :focus-visible,
.sx-contact-card :focus-visible, .sx-track-ai:focus-visible { outline-color: var(--amber); box-shadow: none; }
.sx-menu { min-height: 44px; }
@media (max-width: 600px) {
  .sx-brand small { display: none; }
  .sx-brand { flex-shrink: 1; min-width: 0; }
  .sx-header-in { gap: 12px; padding: 12px 16px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
