/*
 * Site chrome for the static pages (public/articles/**, faq, privacy, terms):
 * utility bar, header, footer and typography, matching the React home page
 * (src/components/IntroductionPage.tsx and the .uhome rules in src/index.css).
 *
 * The markup is written into every page by scripts/apply-site-chrome.cjs.
 * Colours are CSS variables with html.dark overrides, so the generated dark
 * twins of scripts/build-article-dark.js never need to know about this file.
 */
:root {
  --sc-paper: #ffffff;
  --sc-paper-2: #f6f4ef;
  --sc-ink: #1a1a1a;
  --sc-ink-2: #3f3f46;
  --sc-ink-3: #63636b;
  --sc-line: #e3dfd6;
  --sc-navy: #0c2340;
  --sc-navy-2: #12305a;
  --sc-footer: #0a1a30;
  --sc-link: #1b4f8f;
  --sc-accent: #a51c30;
  --sc-serif: 'Source Serif 4', 'Source Serif Pro', Georgia, 'Times New Roman', serif;
  --sc-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
html.dark {
  --sc-paper: #0f1012;
  --sc-paper-2: #16171a;
  --sc-ink: #ececec;
  --sc-ink-2: #c9c9cc;
  --sc-ink-3: #9b9ba1;
  --sc-line: #2a2b2f;
  --sc-navy: #0a1628;
  --sc-navy-2: #0f2140;
  --sc-footer: #08111f;
  --sc-link: #8fb6ee;
  --sc-accent: #e4737f;
}

/* ── page ─────────────────────────────────────────────────────────────── */
html:root body.sc-page {
  background: var(--sc-paper);
  color: var(--sc-ink);
  font-family: var(--sc-sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
.sc-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}
@media (min-width: 640px) { .sc-wrap { padding: 0 24px; } }
@media (min-width: 1024px) { .sc-wrap { padding: 0 32px; } }
.sc-page :where(.sc-utility, .sc-header, .sc-footer) a { text-decoration: none; }
.sc-page :where(.sc-utility, .sc-header, .sc-footer) :focus-visible {
  outline: 2px solid var(--sc-link);
  outline-offset: 2px;
}

/* ── utility bar ──────────────────────────────────────────────────────── */
.sc-utility {
  background: var(--sc-navy);
  color: rgba(255, 255, 255, 0.85);
  font: 13px/1 var(--sc-sans);
}
.sc-utility-in {
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.sc-utility-tag {
  margin: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.sc-utility-links { display: none; align-items: center; gap: 20px; flex-shrink: 0; }
@media (min-width: 640px) { .sc-utility-links { display: flex; } }
.sc-page .sc-utility-links a { color: rgba(255, 255, 255, 0.85); }
.sc-page .sc-utility-links a:hover { color: #fff; text-decoration: underline; text-underline-offset: 4px; }

/* ── header ───────────────────────────────────────────────────────────── */
.sc-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--sc-paper);
  border-bottom: 1px solid var(--sc-line);
  font-family: var(--sc-sans);
}
.sc-header-in {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
@media (min-width: 1024px) { .sc-header-in { height: 84px; } }
.sc-brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; min-width: 0; }
.sc-brand svg { width: 40px; height: 40px; flex-shrink: 0; }
.sc-brand-text { display: flex; flex-direction: column; line-height: 1; min-width: 0; }
.sc-page .sc-wordmark {
  font-family: var(--sc-serif);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: -0.01em;
  color: var(--sc-ink);
}
@media (min-width: 1024px) { .sc-page .sc-wordmark { font-size: 22px; } }
.sc-brandline {
  display: none;
  margin-top: 6px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sc-ink-3);
  white-space: nowrap;
}
@media (min-width: 640px) { .sc-brandline { display: block; } }
@media (min-width: 1280px) and (max-width: 1535px) { .sc-brandline { display: none; } }

.sc-nav { display: none; align-items: center; gap: 24px; }
@media (min-width: 1280px) { .sc-nav { display: flex; } }
@media (min-width: 1536px) { .sc-nav { gap: 32px; } }
.sc-page .sc-nav a {
  position: relative;
  padding: 8px 0;
  font-size: 15px;
  font-weight: 500;
  color: var(--sc-ink-2);
  white-space: nowrap;
  transition: color 0.15s;
}
.sc-page .sc-nav a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--sc-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}
.sc-page .sc-nav a:hover,
.sc-page .sc-nav a[aria-current='page'] { color: var(--sc-ink); }
.sc-page .sc-nav a:hover::after,
.sc-page .sc-nav a[aria-current='page']::after { transform: scaleX(1); }

.sc-actions { display: flex; align-items: center; gap: 8px; color: var(--sc-ink-2); }

/* Buttons: square, like the home page. */
.sc-page .sc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  font: 600 15px/1 var(--sc-sans);
  border-radius: 2px;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: background-color 0.15s, color 0.15s;
}
.sc-page .sc-btn-primary { background: var(--sc-navy); color: #fff; }
.sc-page .sc-btn-primary:hover { background: var(--sc-navy-2); color: #fff; }
html.dark .sc-page .sc-btn-primary { background: #e9eef6; color: #0c2340; }
html.dark .sc-page .sc-btn-primary:hover { background: #fff; color: #0c2340; }
.sc-actions > .sc-btn { display: none; margin-left: 8px; }
@media (min-width: 768px) { .sc-actions > .sc-btn { display: inline-flex; } }

/* Theme toggle (articles-theme.js mounts it first in .sc-actions). */
.sc-page .sc-actions .lgt-theme-toggle {
  width: 36px;
  height: 36px;
  margin: 0;
  border: 1px solid var(--sc-line);
  border-radius: 2px;
  background: transparent;
  color: var(--sc-ink-2);
}
.sc-page .sc-actions .lgt-theme-toggle:hover { color: var(--sc-ink); border-color: var(--sc-ink-3); background: transparent; }

/* Mobile / tablet menu: a <details> disclosure, no script needed. */
.sc-menu { display: block; }
@media (min-width: 1280px) { .sc-menu { display: none; } }
.sc-menu > summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  cursor: pointer;
  color: var(--sc-ink);
}
.sc-menu > summary::-webkit-details-marker { display: none; }
.sc-menu > summary svg { width: 24px; height: 24px; }
.sc-menu .sc-icon-close { display: none; }
.sc-menu[open] .sc-icon-open { display: none; }
.sc-menu[open] .sc-icon-close { display: block; }
.sc-menu-panel {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  background: var(--sc-paper);
  border-top: 1px solid var(--sc-line);
  border-bottom: 1px solid var(--sc-line);
  box-shadow: 0 16px 24px -16px rgba(0, 0, 0, 0.25);
}
.sc-menu-panel .sc-wrap { padding-top: 8px; padding-bottom: 16px; }
.sc-page .sc-menu-panel a.sc-menu-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--sc-line);
  font-size: 17px;
  font-weight: 500;
  color: var(--sc-ink);
}
.sc-menu-link svg { width: 16px; height: 16px; color: var(--sc-ink-3); }
.sc-page .sc-menu-panel .sc-btn { display: flex; width: 100%; margin-top: 16px; }

/* ── footer ───────────────────────────────────────────────────────────── */
.sc-page .sc-footer {
  margin-top: auto;
  background: var(--sc-footer);
  color: rgba(255, 255, 255, 0.7);
  font: 14.5px/1.5 var(--sc-sans);
  border: 0;
}
.sc-footer-in { padding-top: 64px; padding-bottom: 40px; }
.sc-footer-grid { display: grid; gap: 40px; }
@media (min-width: 640px) { .sc-footer-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .sc-footer-grid { grid-template-columns: 4fr 2fr 3fr 3fr; } }
.sc-footer-brand { display: flex; align-items: center; gap: 12px; }
.sc-footer-brand svg { width: 36px; height: 36px; flex-shrink: 0; }
.sc-page .sc-footer-brand span { font: 600 20px/1.2 var(--sc-serif); color: #fff; }
.sc-page .sc-footer p.sc-footer-tag { margin: 20px 0 0; max-width: 320px; color: rgba(255, 255, 255, 0.7); font-size: 14.5px; line-height: 1.6; }
.sc-page .sc-footer-social {
  margin-top: 24px;
  display: inline-flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 0.7);
}
.sc-page .sc-footer-social:hover { border-color: #fff; color: #fff; }
.sc-footer-social svg { width: 16px; height: 16px; }
.sc-page .sc-footer h2 {
  margin: 0;
  font: 600 12px/1.4 var(--sc-sans);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #fff;
  border: 0;
  padding: 0;
}
.sc-footer ul { list-style: none; margin: 16px 0 0; padding: 0; }
.sc-footer li { margin: 0 0 10px; }
.sc-page .sc-footer a { color: rgba(255, 255, 255, 0.7); }
.sc-page .sc-footer a:hover,
.sc-page .sc-footer a[aria-current='true'] { color: #fff; }
.sc-footer-bottom {
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
}
@media (min-width: 640px) { .sc-footer-bottom { flex-direction: row; align-items: center; justify-content: space-between; } }
.sc-page .sc-footer-bottom p { margin: 0; color: rgba(255, 255, 255, 0.55); font-size: 13px; }
.sc-footer-bottom nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.sc-page .sc-footer-bottom a { color: rgba(255, 255, 255, 0.55); }

/* ── page typography (articles, FAQ, legal) ───────────────────────────── */
.sc-page :where(h1, h2, h3):not(.sc-footer *),
.sc-page .font-title {
  font-family: var(--sc-serif) !important;
  font-weight: 600 !important;
  letter-spacing: -0.01em !important;
}
.sc-page h1 { color: var(--sc-ink); line-height: 1.12; }
.sc-page main .article-content h2 { border-bottom-color: var(--sc-line); }

/* Gradient headline text reads as plain ink. */
.sc-page .bg-clip-text.text-transparent {
  background: none !important;
  -webkit-text-fill-color: currentColor;
  color: var(--sc-ink) !important;
}

/* Category pill above an article title → crimson small-caps kicker. */
.sc-page main header > .rounded-full:first-child {
  display: inline-flex !important;
  align-items: center;
  gap: 12px;
  padding: 0 !important;
  background: none !important;
  border: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  color: var(--sc-accent) !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.sc-page main header > .rounded-full:first-child::before {
  content: '';
  width: 32px;
  height: 2px;
  background: currentColor;
}

/* Reading-time strip and author box: flat panels. */
.sc-page main header .rounded-xl,
.sc-page main .article-content > .rounded-xl:first-child {
  border-radius: 2px !important;
  background: var(--sc-paper-2) !important;
  border-color: var(--sc-line) !important;
}

/* Article links in navy. */
.sc-page main .article-content a:not([class*='lgt-']):not(.sc-btn) { color: var(--sc-link); }

/* End-of-article call to action: flat navy band, square button. */
.sc-page main .bg-gradient-to-br.from-gray-900,
.sc-page main .bg-gradient-to-br.from-blue-900 {
  background: var(--sc-navy) !important;
  border-radius: 2px !important;
  box-shadow: none !important;
}
.sc-page main .bg-gradient-to-br.from-gray-900 .blur-3xl,
.sc-page main .bg-gradient-to-br.from-blue-900 .blur-3xl { display: none; }
.sc-page main .bg-gradient-to-br.from-gray-900 a,
.sc-page main .bg-gradient-to-br.from-blue-900 a {
  border-radius: 2px !important;
  box-shadow: none !important;
  transform: none !important;
  color: #0c2340 !important;
  font-weight: 600 !important;
}

/* Breadcrumb current item: no grey pill. */
.sc-page main nav .bg-gray-100.rounded-md { background: none !important; padding: 0 !important; }

/* ── interactive states (links, buttons, chips) in the site palette ───── */
:root .sc-page { --sc-tint: #f1f4f9; --sc-tint-line: #cbd7e8; }
html.dark:root .sc-page { --sc-tint: #181e28; --sc-tint-line: #2e3c52; }

/* Accent text and links: one navy link colour instead of blue/indigo/sky. */
:root .sc-page main :is(.text-blue-500, .text-blue-600, .text-blue-700, .text-blue-800, .text-blue-900,
  .text-indigo-600, .text-indigo-700, .text-indigo-800, .text-indigo-900,
  .text-sky-600, .text-violet-600, .text-purple-600) { color: var(--sc-link); }
:root .sc-page main :is(.hover\:text-blue-600, .hover\:text-blue-800):hover {
  color: var(--sc-navy-2); text-decoration: underline; text-underline-offset: 4px;
}
html.dark:root .sc-page main :is(.hover\:text-blue-600, .hover\:text-blue-800):hover { color: #c3d8f5; }
:root .sc-page main .group:hover :is(.group-hover\:text-blue-600, .group-hover\:text-blue-700, .group-hover\:text-sky-600,
  .group-hover\:text-indigo-600, .group-hover\:text-violet-600, .group-hover\:text-purple-600,
  .group-hover\:text-amber-600, .group-hover\:text-emerald-600, .group-hover\:text-rose-600,
  .group-hover\:text-teal-600, .group-hover\:text-cyan-600, .group-hover\:text-yellow-600,
  .group-hover\:text-orange-600, .group-hover\:text-lime-600, .group-hover\:text-fuchsia-600) {
  color: var(--sc-link); text-decoration: underline; text-underline-offset: 4px;
}

/* Pale blue panels and outlines → the site's cool tint and line colour. */
:root .sc-page main :is(.bg-blue-50, .bg-blue-100, .bg-indigo-50) { background-color: var(--sc-tint); }
:root .sc-page main :is(.border-blue-100, .border-blue-200, .border-indigo-100, .border-indigo-200) { border-color: var(--sc-tint-line); }
:root .sc-page main :is(.border-blue-500, .border-indigo-500) { border-color: var(--sc-navy); }
html.dark:root .sc-page main :is(.border-blue-500, .border-indigo-500) { border-color: var(--sc-link); }

/* Solid buttons: navy, square, no lift. */
:root .sc-page main :is(.bg-blue-500, .bg-blue-600, .bg-blue-700, .bg-indigo-600):not(.opacity-5):not(.rounded-full) {
  background-color: var(--sc-navy); border-radius: 2px;
}
:root .sc-page main :is(.hover\:bg-blue-700, .hover\:bg-indigo-700):hover { background-color: var(--sc-navy-2); }
html.dark:root .sc-page main :is(.bg-blue-500, .bg-blue-600, .bg-blue-700, .bg-indigo-600):not(.opacity-5):not(.rounded-full) { background-color: #2c5591; }
html.dark:root .sc-page main :is(.hover\:bg-blue-700, .hover\:bg-indigo-700):hover { background-color: #3a67a8; }
:root .sc-page main .rounded-bl-full.opacity-5 { display: none; } /* decorative corner blob */

/* Cards and buttons: squared corners, no bounce/zoom/lift on hover. */
:root .sc-page main :is(.rounded-lg, .rounded-xl, .rounded-2xl, .rounded-3xl) { border-radius: 3px; }
:root .sc-page main :is(.hover\:-translate-y-1, .hover\:-translate-y-0\.5, .hover\:scale-105):hover,
:root .sc-page main .group:hover .group-hover\:scale-105 { transform: none; }
:root .sc-page main :is(.hover\:shadow-lg, .hover\:shadow-xl, .hover\:shadow-md):hover { box-shadow: none; border-color: var(--sc-ink-3); }
:root .sc-page main :is(.hover\:bg-gray-50, .hover\:bg-gray-100):hover { background-color: var(--sc-paper-2); }

/* Article language switcher: the current language is a solid navy chip. */
:root .sc-page main a.ring-1.ring-blue-200 {
  background: var(--sc-navy); color: #fff; box-shadow: none; --tw-ring-shadow: 0 0 #0000; border-radius: 2px;
}
html.dark:root .sc-page main a.ring-1.ring-blue-200 { background: #e9eef6; color: #0c2340; }
:root .sc-page main a.px-2\.5.py-1:not(.ring-1) { border-radius: 2px; }

/* Keyboard focus. */
:root .sc-page main :is(a, button, summary, [tabindex]):focus-visible { outline: 2px solid var(--sc-link); outline-offset: 2px; }

/* Book card / rail, mid-article promo and the contact card buttons. */
:root .sc-page .lgt-bk .lgt-bk-eyebrow { color: var(--sc-accent); letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.7rem; }
:root .sc-page .lgt-bk .lgt-bk-chip { border-radius: 2px; }
:root .sc-page .lgt-bk .lgt-bk-buy {
  border-radius: 2px; border-color: var(--sc-navy); background: var(--sc-navy); color: #fff; box-shadow: none;
}
:root .sc-page .lgt-bk .lgt-bk-buy:hover { background: var(--sc-navy-2); border-color: var(--sc-navy-2); color: #fff; }
:root .sc-page .lgt-bk .lgt-bk-buy:active { background: var(--sc-navy); }
:root .sc-page .lgt-bk .lgt-bk-buy:focus-visible { outline-color: var(--sc-link); }
html.dark:root .sc-page .lgt-bk .lgt-bk-buy { background: #e9eef6; border-color: #e9eef6; color: #0c2340; }
html.dark:root .sc-page .lgt-bk .lgt-bk-buy:hover { background: #fff; border-color: #fff; color: #0c2340; }
:root .sc-page .lgt-promo .lgt-promo-btn {
  border-radius: 2px; background: var(--sc-navy); box-shadow: none; transition: background-color 0.15s;
}
:root .sc-page .lgt-promo .lgt-promo-btn:hover { background: var(--sc-navy-2); filter: none; transform: none; box-shadow: none; }
html.dark:root .sc-page .lgt-promo .lgt-promo-btn { background: #e9eef6; color: #0c2340; }
html.dark:root .sc-page .lgt-promo .lgt-promo-btn:hover { background: #fff; }
:root .sc-page .lgt-cx { --cx-acc: var(--sc-navy); }
:root .sc-page .lgt-cx .lgt-cx-btn { border-radius: 2px; box-shadow: none; }
:root .sc-page .lgt-cx .lgt-cx-btn:hover { filter: none; transform: none; background: var(--sc-navy-2); color: #fff; }
:root .sc-page .lgt-cx .lgt-cx-btn.is-outline:hover { background: var(--sc-navy); }
:root .sc-page .lgt-cx .lgt-cx-btn:focus-visible { outline-color: var(--sc-link); }

/* FAQ / legal pages: their CTA band and accordions sit outside <main>. */
:root .sc-page [class*='bg-gradient-to']:is([class*='from-blue-500'], [class*='from-blue-600'], [class*='from-indigo-600'], [class*='from-purple-600']) {
  background-image: none; background-color: var(--sc-navy);
}
:root .sc-page :is(section, div)[class*='bg-gradient-to'] :is(button, a).bg-white { border-radius: 2px; color: var(--sc-navy); box-shadow: none; transform: none; }
html.dark:root .sc-page :is(section, div)[class*='bg-gradient-to'] :is(button, a).bg-white { background: #e9eef6; color: #0c2340; }
:root .sc-page :not(.sc-utility):not(.sc-header):not(.sc-footer) > :is(.rounded-lg, .rounded-xl, .rounded-2xl, .rounded-3xl) { border-radius: 3px; }
:root .sc-page :is(.text-blue-600, .text-blue-700, .text-blue-800, .text-purple-600, .text-indigo-600):not(.sc-header *):not(.sc-footer *) { color: var(--sc-link); }
:root .sc-page section[class*='bg-gradient-to'] .text-blue-600 { color: var(--sc-navy); }
:root .sc-page :is(.hover\:-translate-y-1, .hover\:scale-105):hover { transform: none; }

/* Footer contact: the email address in a bordered chip (replaces the LinkedIn icon). */
.sc-page .sc-footer-social.sc-footer-email {
  width: auto; height: auto; min-height: 36px; gap: 8px; padding: 6px 12px;
  font-size: 13.5px; line-height: 1.3; word-break: break-all; text-decoration: none;
}
.sc-page .sc-footer-social.sc-footer-email svg { flex-shrink: 0; }

/* "Copy email" buttons (scripts/apply-site-chrome.cjs + /site-chrome.js). */
.sc-page .sc-copy-email {
  display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0;
  background: none; color: inherit; font: inherit; cursor: pointer;
}
.sc-page .sc-copy-email svg { width: 14px; height: 14px; flex-shrink: 0; }
.sc-page .sc-utility-links .sc-copy-email { color: rgba(255, 255, 255, 0.85); }
.sc-page .sc-utility-links .sc-copy-email:hover { color: #fff; text-decoration: underline; text-underline-offset: 4px; }
.sc-page .sc-footer-social.sc-footer-email { border: 1px solid rgba(255, 255, 255, 0.25); padding: 6px 12px; }
.sc-page .sc-copy-email.is-copied { color: #fff; }
.sc-page .sc-copy-email.sc-copy-inline { display: inline; color: var(--sc-link); text-decoration: underline; text-underline-offset: 3px; }
