:root {
  --refresh-navy: #0d2447;
  --refresh-teal: #20908e;
  --refresh-deep: #071a2b;
  --refresh-footer: #051522;
  --refresh-mint: #9ef0cf;
  --refresh-bg: #f8fafb;
  --refresh-alt: #eef3f5;
  --refresh-text: #17212b;
  --refresh-muted: #60707c;
  --refresh-border: #d7e0e7;
  --refresh-shadow: 0 24px 70px rgba(13, 36, 71, 0.09);
}

html {
  scroll-padding-top: 106px;
}

body {
  overflow-x: hidden;
  background-color: var(--refresh-bg);
  color: var(--refresh-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: rgba(32, 144, 142, 0.22);
  color: var(--refresh-navy);
}

:focus-visible {
  outline: 3px solid var(--refresh-teal) !important;
  outline-offset: 4px !important;
}

header.fixed > nav[aria-label="Primary navigation"],
.site-header .site-nav {
  max-width: 1240px;
  min-height: 64px;
  border-color: rgba(215, 224, 231, 0.84) !important;
  border-radius: 18px !important;
  background: rgba(255, 255, 255, 0.93) !important;
  box-shadow: 0 10px 32px rgba(7, 26, 43, 0.09);
  backdrop-filter: blur(18px);
}

header.fixed > nav[aria-label="Primary navigation"] a,
.site-header .site-nav a {
  font-weight: 700;
}

header.fixed > nav[aria-label="Primary navigation"] > div[aria-label="Main sections"] a,
.site-header .site-nav .desktop-nav a,
.site-header .site-nav .nav-link {
  color: #405365 !important;
}

header.fixed > nav[aria-label="Primary navigation"] > div[aria-label="Main sections"] a:hover,
header.fixed > nav[aria-label="Primary navigation"] > div[aria-label="Main sections"] a:focus-visible,
.site-header .site-nav .desktop-nav a:hover,
.site-header .site-nav .desktop-nav a:focus-visible,
.site-header .site-nav .nav-link:hover,
.site-header .site-nav .nav-link:focus-visible {
  color: var(--refresh-navy) !important;
}

header.fixed > nav[aria-label="Primary navigation"] > div[aria-label="Main sections"] a[aria-current="page"],
.site-header .site-nav .desktop-nav a[aria-current="page"],
.site-header .site-nav .nav-link[aria-current="page"] {
  color: var(--refresh-navy) !important;
}

header.fixed > nav[aria-label="Primary navigation"] a[aria-label*="Sovereign SLM Labs"] > span,
.site-header .site-nav .brand,
.site-header .site-nav .brand span {
  color: var(--refresh-navy) !important;
}

header.fixed > nav[aria-label="Primary navigation"] button[aria-controls*="mobile"],
header.fixed > nav[aria-label="Primary navigation"] button[aria-label*="navigation"],
.site-header .site-nav .menu-button {
  border-color: var(--refresh-border) !important;
  background: #fff !important;
  color: var(--refresh-navy) !important;
}

header.fixed img[src*="favicon-192x192"],
.site-header img[src*="favicon-192x192"] {
  width: 46px;
  height: 46px;
  object-fit: contain;
}

header.fixed a[aria-current="page"] {
  background: var(--refresh-alt) !important;
  color: var(--refresh-navy) !important;
}

#themeToggle {
  border-color: var(--refresh-border) !important;
  color: var(--refresh-navy) !important;
}

.hero-bg,
main > section:first-child.bg-ink,
main > section:first-child[class*="bg-ink"] {
  background:
    radial-gradient(circle at 14% 8%, rgba(32, 144, 142, 0.2), transparent 31%),
    radial-gradient(circle at 85% 20%, rgba(121, 217, 255, 0.1), transparent 32%),
    linear-gradient(135deg, #071a2b 0%, #0d2447 60%, #051522 100%) !important;
}

main > section:first-child h1,
.hero h1 {
  font-weight: 760 !important;
  letter-spacing: -0.055em !important;
  line-height: 0.98 !important;
  text-wrap: balance;
}

main > section:first-child p {
  line-height: 1.7;
}

main section[id] {
  scroll-margin-top: 112px;
}

.article-prose {
  border-color: var(--refresh-border) !important;
  border-radius: 28px !important;
  box-shadow: var(--refresh-shadow) !important;
}

.article-prose > section {
  max-width: 78ch;
  margin-inline: auto;
}

.article-prose p {
  max-width: 72ch;
  color: #465966;
  font-size: clamp(1rem, 1.2vw, 1.08rem);
  line-height: 1.82 !important;
}

.article-prose h2,
.article-prose h3 {
  color: var(--refresh-navy);
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.article-prose h2 {
  line-height: 1.08;
}

.article-prose a:not(.citation) {
  text-decoration-color: rgba(32, 144, 142, 0.42);
  text-underline-offset: 3px;
}

.article-prose ul,
.article-prose ol,
.article-prose blockquote,
.article-prose table,
.article-prose details {
  max-width: 72ch;
}

.article-prose li {
  line-height: 1.72;
}

.article-prose details,
main article[class*="rounded-2xl"],
main article[class*="rounded-3xl"] {
  border-color: var(--refresh-border) !important;
  border-radius: 20px !important;
  background-color: rgba(255, 255, 255, 0.92);
  box-shadow: 0 14px 38px rgba(13, 36, 71, 0.055);
}

main article[class*="rounded-2xl"]:hover,
main article[class*="rounded-3xl"]:hover {
  border-color: rgba(32, 144, 142, 0.38) !important;
}

main img {
  height: auto;
}

figure[class*="rounded-3xl"],
figure[class*="rounded-2xl"] {
  overflow: hidden;
  border-radius: 24px !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border: 1px solid var(--refresh-border);
  border-radius: 16px;
}

th {
  background: var(--refresh-navy);
  color: white;
}

th,
td {
  padding: 13px 15px;
  border-bottom: 1px solid var(--refresh-border);
  vertical-align: top;
}

tr:last-child td {
  border-bottom: 0;
}

aside > div[class*="sticky"] {
  border-color: var(--refresh-border) !important;
  border-radius: 24px !important;
  background: rgba(255, 255, 255, 0.96) !important;
  box-shadow: var(--refresh-shadow) !important;
}

a[class*="bg-tealbrand"],
button[class*="bg-tealbrand"] {
  background-color: var(--refresh-mint) !important;
  color: var(--refresh-deep) !important;
  border-radius: 999px !important;
  font-weight: 800 !important;
}

a[class*="bg-tealbrand"]:hover,
button[class*="bg-tealbrand"]:hover {
  background-color: #b9f6df !important;
}

body > footer,
main + footer {
  margin-top: 0;
  padding: 34px max(22px, calc((100vw - 1180px) / 2));
  background: var(--refresh-footer);
  color: white;
}

body > footer > div,
main + footer > div {
  max-width: 1180px !important;
  margin-inline: auto;
  border-color: rgba(255, 255, 255, 0.1) !important;
  background: transparent !important;
}

body > footer p,
body > footer a,
main + footer p,
main + footer a {
  color: #c7d1d8 !important;
}

body > footer a:hover,
main + footer a:hover {
  color: var(--refresh-mint) !important;
}

.site-header {
  padding: 14px 20px;
}

.site-header .site-nav {
  padding: 8px 12px;
}

.answer-strip,
.section.alt,
section[class*="bg-slate-100"] {
  background-color: var(--refresh-alt) !important;
}

.card,
.pain-card {
  border-color: var(--refresh-border) !important;
  border-radius: 20px !important;
  box-shadow: 0 14px 38px rgba(13, 36, 71, 0.055);
}

@media (max-width: 900px) {
  .article-prose > section {
    max-width: none;
  }

  .article-prose p,
  .article-prose ul,
  .article-prose ol,
  .article-prose blockquote,
  .article-prose table,
  .article-prose details {
    max-width: none;
  }
}

@media (max-width: 700px) {
  .grid > * {
    min-width: 0;
  }

  header.fixed {
    padding: 8px !important;
  }

  header.fixed > nav[aria-label="Primary navigation"],
  .site-header .site-nav {
    min-height: 60px;
    border-radius: 15px !important;
  }

  header.fixed img[src*="favicon-192x192"],
  .site-header img[src*="favicon-192x192"] {
    width: 42px;
    height: 42px;
  }

  main > section:first-child h1,
  .hero h1 {
    font-size: clamp(2.7rem, 13vw, 4.4rem) !important;
  }

  .article-prose {
    border-radius: 20px !important;
  }

  header.fixed > nav[aria-label="Primary navigation"] a[aria-label*="Sovereign SLM Labs"] > span,
  .site-header .site-nav .brand span {
    max-width: min(47vw, 180px) !important;
  }

  header.fixed > nav[aria-label="Primary navigation"] button[aria-controls*="mobile"],
  header.fixed > nav[aria-label="Primary navigation"] button[aria-label*="navigation"],
  .site-header .site-nav .menu-button {
    width: 44px;
    min-width: 44px;
    height: 44px;
  }

  table {
    display: block;
    overflow-x: auto;
    white-space: normal;
  }
}

@media (max-width: 360px) {
  #themeToggle,
  #theme-toggle {
    display: none !important;
  }

  header.fixed > nav[aria-label="Primary navigation"] a[aria-label*="Sovereign SLM Labs"] > span,
  .site-header .site-nav .brand span {
    max-width: min(62vw, 190px) !important;
  }
}

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

/* Shared global-presence footer */
.sov-global-footer {
  --sov-footer-navy: #051522;
  --sov-footer-navy-2: #071b2a;
  --sov-footer-mint: #9ef0cf;
  --sov-footer-text: #c7d1d8;
  --sov-footer-muted: #8296a1;
  --sov-footer-line: rgba(255, 255, 255, 0.1);
  margin: 0;
  padding: 76px 0 28px;
  background: var(--sov-footer-navy);
  color: #fff;
}

.sov-footer-wrap { width: min(1180px, calc(100% - 44px)); margin-inline: auto; }
.sov-footer-top { display: grid; grid-template-columns: 1.15fr 1.85fr; gap: 80px; padding-bottom: 56px; }
.sov-footer-brand h2 { margin: 0 0 16px; color: #fff; font-size: 28px; line-height: 1; letter-spacing: -0.04em; }
.sov-footer-brand p { max-width: 390px; margin: 0; color: var(--sov-footer-text) !important; font-size: 15px; line-height: 1.7; }
.sov-footer-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 30px; }
.sov-footer-column h3 { margin: 0 0 16px; color: var(--sov-footer-muted); font-size: 11px; font-weight: 850; letter-spacing: 0.12em; text-transform: uppercase; }
.sov-footer-column a { display: block; width: fit-content; margin: 10px 0; color: var(--sov-footer-text) !important; font-size: 14px; line-height: 1.45; text-decoration: none; text-underline-offset: 4px; transition: color 0.2s ease; }
.sov-footer-column a:hover, .sov-footer-column a:focus-visible { color: var(--sov-footer-mint) !important; text-decoration: underline; }
.sov-presence { padding: 28px 0 30px; border-top: 1px solid var(--sov-footer-line); border-bottom: 1px solid var(--sov-footer-line); }
.sov-presence-head { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.sov-presence-label { margin: 0; color: var(--sov-footer-muted); font-size: 11px; font-weight: 850; letter-spacing: 0.14em; text-transform: uppercase; }
.sov-presence-note { margin: 0; color: #a8b8c0 !important; font-size: 13px; }
.sov-location-route { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.sov-location-route::before { position: absolute; top: 8px; right: 6%; left: 6%; height: 1px; background: linear-gradient(90deg, rgba(158, 240, 207, 0.18), rgba(158, 240, 207, 0.42), rgba(158, 240, 207, 0.18)); content: ""; }
.sov-location { position: relative; padding-top: 30px; }
.sov-location::before { position: absolute; top: 4px; left: 0; width: 9px; height: 9px; border: 2px solid var(--sov-footer-mint); border-radius: 50%; background: var(--sov-footer-navy); box-shadow: 0 0 0 5px rgba(158, 240, 207, 0.04); content: ""; }
.sov-location h3 { margin: 0; color: #fff; font-size: 20px; line-height: 1.2; letter-spacing: -0.03em; }
.sov-location p { margin: 6px 0 0; color: var(--sov-footer-muted) !important; font-size: 12px; }
.sov-footer-bottom { display: flex; align-items: center; justify-content: space-between; gap: 28px; padding-top: 26px; color: var(--sov-footer-muted); font-size: 12px; }
.sov-footer-bottom p { margin: 0; color: var(--sov-footer-muted) !important; }
.sov-footer-legal { display: flex; flex-wrap: wrap; gap: 20px; }
.sov-footer-legal a { color: var(--sov-footer-muted) !important; text-decoration: none; text-underline-offset: 4px; }
.sov-footer-legal a:hover, .sov-footer-legal a:focus-visible { color: #fff !important; text-decoration: underline; }

@media (max-width: 900px) {
  .sov-footer-top { grid-template-columns: 1fr; gap: 48px; }
  .sov-footer-links { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .sov-global-footer { padding: 60px 0 28px; }
  .sov-footer-wrap { width: calc(100% - 26px); }
  .sov-footer-links { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 20px; }
  .sov-presence-head { align-items: flex-start; flex-direction: column; }
  .sov-location-route { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 18px; }
  .sov-location-route::before { display: none; }
  .sov-location { padding-top: 0; padding-left: 20px; }
  .sov-location::before { top: 7px; width: 7px; height: 7px; }
  .sov-footer-bottom { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 380px) {
  .sov-footer-links { grid-template-columns: 1fr; }
}
