/* MAINELY CODE — sitewide polish + resilience pass — 2026-08-02 */
:root {
  --mc-bg: #01112a;
  --mc-bg-deep: #000916;
  --mc-panel: rgba(4, 30, 58, .78);
  --mc-panel-strong: rgba(3, 24, 51, .94);
  --mc-text: #f8fbff;
  --mc-soft: #d9f7ff;
  --mc-muted: #a8c2d7;
  --mc-line: rgba(176, 222, 255, .16);
  --mc-line-strong: rgba(0, 210, 255, .38);
  --mc-cyan: #28dcff;
  --mc-teal: #2af0c4;
  --mc-gold: #ffd166;
  --mc-shadow: 0 28px 90px rgba(0, 0, 0, .42);
  --mc-shadow-soft: 0 18px 54px rgba(0, 0, 0, .28);
  --mc-radius: 24px;
  --mc-header-height: 88px;
  color-scheme: dark;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--mc-header-height) + 24px);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  font-synthesis: none;
  background: var(--mc-bg);
}

body.mc-polished {
  min-width: 320px;
  overflow-x: clip;
  accent-color: var(--mc-teal);
}

body.mc-nav-open { overflow: hidden; }

::selection {
  color: #001126;
  background: var(--mc-teal);
}

:where(a, button, input, textarea, select, summary):focus-visible {
  outline: 3px solid var(--mc-teal) !important;
  outline-offset: 4px !important;
  box-shadow: 0 0 0 7px rgba(42, 240, 196, .13) !important;
}

:where(h1, h2, h3) {
  text-wrap: balance;
  overflow-wrap: anywhere;
}

:where(p, li, figcaption) { text-wrap: pretty; }
:where(pre, code, samp, kbd) { overflow-wrap: anywhere; }
:where(img, video, canvas, svg) { max-width: 100%; }
:where(main > section, [id]) { scroll-margin-top: calc(var(--mc-header-height) + 24px); }

/* Accessible skip link */
.mc-skip {
  position: fixed;
  z-index: 10000;
  top: 12px;
  left: 12px;
  padding: .8rem 1rem;
  border-radius: 999px;
  color: #001126;
  background: linear-gradient(135deg, var(--mc-cyan), var(--mc-teal));
  font-weight: 900;
  transform: translateY(-180%);
  transition: transform .18s ease;
}
.mc-skip:focus { transform: translateY(0); }

/* One consistent site header across every generation of the site. */
.mc-header {
  position: sticky;
  z-index: 1000;
  top: 0;
  min-height: var(--mc-header-height);
  border-bottom: 1px solid rgba(57, 203, 255, .22);
  background:
    linear-gradient(180deg, rgba(1, 17, 42, .96), rgba(1, 13, 34, .91)),
    radial-gradient(circle at 20% 0, rgba(40, 220, 255, .12), transparent 36rem);
  -webkit-backdrop-filter: blur(20px) saturate(145%);
  backdrop-filter: blur(20px) saturate(145%);
  box-shadow: 0 10px 34px rgba(0, 0, 0, .24);
}
.mc-header::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 1px;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(40, 220, 255, .48), rgba(42, 240, 196, .34), transparent);
}
.mc-header-inner {
  position: relative;
  display: flex;
  width: min(1240px, calc(100% - 36px));
  min-height: var(--mc-header-height);
  margin: 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.mc-brand {
  display: inline-flex;
  flex: 0 1 286px;
  width: min(286px, 48vw);
  min-width: 0;
  align-items: center;
}
.mc-brand img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0 !important;
  background: #01112a;
  box-shadow: none !important;
}
.mc-nav {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(.28rem, .7vw, .7rem);
  font-size: clamp(.82rem, .84vw, .94rem);
}
.mc-nav a {
  position: relative;
  display: inline-flex;
  min-height: 42px;
  padding: .68rem .72rem;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 999px;
  color: #cbe7f8;
  font-weight: 760;
  line-height: 1;
  white-space: nowrap;
  transition: color .18s ease, background .18s ease, border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.mc-nav a:hover {
  color: #fff;
  border-color: rgba(40, 220, 255, .22);
  background: rgba(40, 220, 255, .07);
}
.mc-nav a[aria-current="page"] {
  color: #fff;
  border-color: rgba(42, 240, 196, .34);
  background: linear-gradient(135deg, rgba(40, 220, 255, .13), rgba(42, 240, 196, .10));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 0 24px rgba(40, 220, 255, .09);
}
.mc-nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  right: 24%;
  bottom: 4px;
  left: 24%;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--mc-cyan), var(--mc-teal));
  box-shadow: 0 0 14px rgba(40, 220, 255, .55);
}
.mc-nav .mc-nav-cta {
  margin-left: .2rem;
  color: #001126;
  border-color: transparent;
  background: linear-gradient(135deg, var(--mc-cyan), var(--mc-teal));
  box-shadow: 0 12px 30px rgba(40, 220, 255, .16);
}
.mc-nav .mc-nav-cta:hover {
  color: #001126;
  border-color: transparent;
  background: linear-gradient(135deg, #8bf0ff, #7dffd9);
  transform: translateY(-1px);
}
.mc-nav-toggle {
  display: none;
  min-width: 92px;
  min-height: 44px;
  padding: .68rem .85rem;
  align-items: center;
  justify-content: center;
  gap: .65rem;
  border: 1px solid rgba(40, 220, 255, .3);
  border-radius: 999px;
  color: #fff;
  background: rgba(40, 220, 255, .08);
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}
.mc-nav-toggle-icon { display: grid; width: 18px; gap: 4px; }
.mc-nav-toggle-icon i {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition: transform .2s ease, opacity .2s ease;
}
.mc-nav-toggle[aria-expanded="true"] .mc-nav-toggle-icon i:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.mc-nav-toggle[aria-expanded="true"] .mc-nav-toggle-icon i:nth-child(2) { opacity: 0; }
.mc-nav-toggle[aria-expanded="true"] .mc-nav-toggle-icon i:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.mc-nav-scrim { display: none; }

/* More deliberate type rhythm and component finish without flattening product-specific themes. */
body.mc-polished :where(.wrap, .mc-content-width) { width: min(100%, 1240px); }
body.mc-polished :where(.section, .mystery-section) { position: relative; }
body.mc-polished :where(.section-head, .section-heading) > p:last-child { max-width: 820px; }
body.mc-polished .section-heading.center > p { margin-inline: auto; }

body.mc-polished :where(.btn, .button, .nav-cta) {
  min-height: 44px;
  -webkit-tap-highlight-color: rgba(42, 240, 196, .18);
}
body.mc-polished :where(.btn, .button):active { transform: translateY(1px) scale(.995); }

body.mc-polished :where(.card, .proof-card, .value-card, .path-card, .problem-card, .handoff-card, .offer-card, .faq-card, .workflow-card, .matrix-card, .interface-point, .ns-capability, .ns-family-card, .ns-principle, .ns-layer) {
  isolation: isolate;
  backface-visibility: hidden;
}

@media (hover: hover) and (pointer: fine) {
  body.mc-polished :where(.card, .proof-card, .value-card, .path-card, .problem-card, .handoff-card, .offer-card, .faq-card, .workflow-card, .interface-point, .ns-capability, .ns-family-card, .ns-principle, .ns-layer) {
    transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease, background .22s ease;
  }
  body.mc-polished :where(.card, .proof-card, .value-card, .path-card, .problem-card, .handoff-card, .offer-card, .faq-card, .workflow-card, .interface-point, .ns-capability, .ns-family-card, .ns-principle, .ns-layer):hover {
    transform: translateY(-3px);
    border-color: rgba(40, 220, 255, .34);
    box-shadow: 0 22px 58px rgba(0, 0, 0, .26), 0 0 28px rgba(40, 220, 255, .06);
  }
}

/* Product screenshots and visual assets */
.product-ui-figure,
.ns-poster {
  position: relative;
}
.product-ui-figure img,
.ns-poster img {
  image-rendering: auto;
}
.product-ui-figure {
  border-color: rgba(40, 220, 255, .28) !important;
  background: linear-gradient(180deg, rgba(5, 28, 57, .9), rgba(0, 9, 24, .95)) !important;
  box-shadow: 0 34px 100px rgba(0, 0, 0, .48), 0 0 48px rgba(40, 220, 255, .08) !important;
}
.product-ui-figure figcaption,
.ns-visual-grid figcaption {
  display: grid;
  gap: .25rem;
  padding: .9rem 1rem;
  border-top: 1px solid rgba(40, 220, 255, .16);
  color: var(--mc-muted);
  background: rgba(1, 17, 42, .88);
  font-size: .88rem;
}
.product-ui-figure figcaption strong { color: #fff; }
.ns-visual-grid figcaption {
  margin: 0;
  color: #cfeeff;
  text-align: center;
}
.mc-image-expand {
  position: absolute;
  z-index: 4;
  top: 12px;
  right: 12px;
  display: inline-flex;
  min-width: 42px;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 999px;
  color: #fff;
  background: rgba(0, 9, 24, .76);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .32);
  cursor: pointer;
}
.mc-image-expand:hover { border-color: rgba(40, 220, 255, .5); background: rgba(3, 32, 65, .9); }
.mc-image-dialog {
  width: min(96vw, 1680px);
  max-width: none;
  max-height: 94vh;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(40, 220, 255, .38);
  border-radius: 22px;
  color: #fff;
  background: #000916;
  box-shadow: 0 40px 140px rgba(0, 0, 0, .78), 0 0 60px rgba(40, 220, 255, .12);
}
.mc-image-dialog::backdrop { background: rgba(0, 5, 16, .86); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.mc-image-dialog-shell { position: relative; display: grid; max-height: 94vh; overflow: auto; }
.mc-image-dialog img { display: block; width: 100%; height: auto; max-height: 90vh; object-fit: contain; background: #000916; }
.mc-image-dialog-close {
  position: sticky;
  z-index: 2;
  top: 12px;
  justify-self: end;
  margin: 12px 12px -54px 0;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 50%;
  color: #fff;
  background: rgba(0, 9, 24, .82);
  font-size: 1.35rem;
  cursor: pointer;
}

/* Tables, code and forms: resilient on phones and long technical strings. */
body.mc-polished :where(.table-wrap, .codeblock, .proof-console, pre) {
  scrollbar-width: thin;
  scrollbar-color: rgba(40, 220, 255, .48) rgba(0, 9, 22, .55);
}
body.mc-polished :where(.table-wrap, .codeblock, .proof-console) { overscroll-behavior-inline: contain; }
body.mc-polished .table-wrap { box-shadow: var(--mc-shadow-soft); }
body.mc-polished table { min-width: 680px; }
body.mc-polished th { position: sticky; top: 0; z-index: 1; }
body.mc-polished :where(input, textarea, select) {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(176, 222, 255, .2);
  border-radius: 14px;
  color: #fff;
  background: rgba(0, 9, 22, .68);
  font: inherit;
}
body.mc-polished :where(input, textarea) { padding: .78rem .88rem; }
body.mc-polished textarea { min-height: 140px; resize: vertical; }
body.mc-polished :where(input, textarea, select)::placeholder { color: #7897ae; opacity: 1; }

/* Back to top and scroll progress */
.mc-scroll-progress {
  position: fixed;
  z-index: 1200;
  top: 0;
  left: 0;
  width: var(--mc-scroll-progress, 0%);
  height: 2px;
  pointer-events: none;
  background: linear-gradient(90deg, var(--mc-cyan), var(--mc-teal), var(--mc-gold));
  box-shadow: 0 0 18px rgba(40, 220, 255, .7);
}
.mc-back-to-top {
  position: fixed;
  z-index: 900;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid rgba(40, 220, 255, .3);
  border-radius: 50%;
  color: #fff;
  background: rgba(1, 17, 42, .88);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 16px 42px rgba(0, 0, 0, .34);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease, border-color .2s ease;
  cursor: pointer;
}
.mc-back-to-top.is-visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.mc-back-to-top:hover { border-color: var(--mc-cyan); }

/* Unified footer */
.mc-footer {
  position: relative;
  z-index: 2;
  margin-top: clamp(54px, 8vw, 110px);
  border-top: 1px solid rgba(40, 220, 255, .18);
  background:
    radial-gradient(circle at 15% 0, rgba(40, 220, 255, .1), transparent 28rem),
    radial-gradient(circle at 88% 12%, rgba(42, 240, 196, .07), transparent 28rem),
    linear-gradient(180deg, rgba(1, 17, 42, .88), rgba(0, 7, 18, .98));
}
.mc-footer::before {
  content: "";
  position: absolute;
  top: -1px;
  right: 10%;
  left: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(40, 220, 255, .52), rgba(42, 240, 196, .42), transparent);
}
.mc-footer-inner { width: min(1240px, calc(100% - 36px)); margin: 0 auto; padding: 56px 0 26px; }
.mc-footer-grid { display: grid; grid-template-columns: minmax(260px, 1.4fr) repeat(3, minmax(150px, .7fr)); gap: clamp(24px, 4vw, 54px); }
.mc-footer-brand img { display: block; width: min(330px, 100%); height: auto; margin-bottom: 1rem; background: #01112a; }
.mc-footer-brand p { max-width: 520px; color: var(--mc-muted); }
.mc-footer-email { display: inline-flex; margin-top: .35rem; color: var(--mc-teal); font-weight: 850; }
.mc-footer-column { display: flex; flex-direction: column; align-items: flex-start; gap: .55rem; }
.mc-footer-column h2 { margin: 0 0 .55rem; color: #fff; font-size: .78rem; letter-spacing: .15em; text-transform: uppercase; }
.mc-footer-column a { color: #b9d4e5; font-size: .94rem; }
.mc-footer-column a:hover { color: #fff; }
.mc-footer-bottom {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1.2rem 2rem;
  margin-top: 38px;
  padding-top: 22px;
  border-top: 1px solid rgba(176, 222, 255, .1);
}
.mc-footer-bottom p { margin: 0; color: #849fb2; font-size: .8rem; }
.mc-footer-bottom p:last-child { justify-self: end; max-width: 760px; text-align: right; }

/* Small visual refinements to Northstar without cropping embedded artwork. */
body.northstar-site .ns-visual-grid .ns-poster:first-child img { width: 100%; height: auto !important; object-fit: contain !important; }
body.northstar-site .ns-visual-grid .ns-poster { overflow: hidden; }
body.northstar-site .ns-hero-art { transform: translateZ(0); }

@media (max-width: 1120px) {
  :root { --mc-header-height: 82px; }
  .mc-header-inner { min-height: var(--mc-header-height); }
  .mc-brand { flex-basis: 250px; width: min(250px, 62vw); }
  html.mc-js .mc-nav-toggle { display: inline-flex; }
  html.mc-js .mc-nav {
    position: fixed;
    z-index: 1002;
    top: calc(var(--mc-header-height) + 10px);
    right: 18px;
    left: 18px;
    display: none;
    max-height: calc(100dvh - var(--mc-header-height) - 28px);
    padding: 14px;
    overflow-y: auto;
    flex-direction: column;
    align-items: stretch;
    gap: .25rem;
    border: 1px solid rgba(40, 220, 255, .28);
    border-radius: 22px;
    background: rgba(1, 17, 42, .985);
    box-shadow: 0 28px 90px rgba(0, 0, 0, .58);
  }
  html.mc-js .mc-nav.is-open { display: flex; animation: mc-nav-in .18s ease-out both; }
  html.mc-js .mc-nav a { justify-content: space-between; width: 100%; min-height: 48px; padding: .82rem .9rem; border-radius: 14px; white-space: normal; }
  html.mc-js .mc-nav .mc-nav-cta { justify-content: center; margin: .35rem 0 0; }
  html.mc-js .mc-nav-scrim {
    position: fixed;
    z-index: 1001;
    inset: var(--mc-header-height) 0 0;
    display: block;
    visibility: hidden;
    background: rgba(0, 5, 16, .68);
    opacity: 0;
    transition: opacity .18s ease, visibility .18s ease;
  }
  html.mc-js .mc-nav-scrim.is-open { visibility: visible; opacity: 1; }
  .mc-footer-grid { grid-template-columns: 1.2fr repeat(2, .8fr); }
  .mc-footer-column:last-child { grid-column: 2 / -1; }
}

@keyframes mc-nav-in {
  from { opacity: 0; transform: translateY(-8px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 760px) {
  :root { --mc-header-height: 76px; }
  .mc-header-inner { width: min(100% - 28px, 1240px); }
  .mc-brand { flex-basis: 215px; width: min(215px, 58vw); }
  .mc-nav-toggle { min-width: 48px; width: 48px; padding: .65rem; }
  .mc-nav-toggle-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .mc-footer-inner { width: min(100% - 32px, 1240px); padding-top: 44px; }
  .mc-footer-grid { grid-template-columns: 1fr 1fr; gap: 28px 24px; }
  .mc-footer-brand { grid-column: 1 / -1; }
  .mc-footer-column:last-child { grid-column: auto; }
  .mc-footer-bottom { grid-template-columns: 1fr; }
  .mc-footer-bottom p:last-child { justify-self: start; text-align: left; }
  .product-ui-figure figcaption, .ns-visual-grid figcaption { font-size: .8rem; }
  .mc-image-expand { top: 8px; right: 8px; width: 38px; min-width: 38px; height: 38px; min-height: 38px; }
  body.mc-polished table { min-width: 620px; }
}

@media (max-width: 480px) {
  .mc-footer-grid { grid-template-columns: 1fr; }
  .mc-footer-brand { grid-column: auto; }
  .mc-footer-column:last-child { grid-column: auto; }
  .mc-back-to-top { width: 42px; height: 42px; }
}

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

@media print {
  .mc-header, .mc-footer, .mc-back-to-top, .mc-scroll-progress, .mc-image-expand { display: none !important; }
  body.mc-polished { background: #fff !important; color: #111 !important; }
  body.mc-polished :where(h1, h2, h3, p, li, a) { color: #111 !important; text-shadow: none !important; }
  body.mc-polished a { text-decoration: underline; }
}
.mc-visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
