/* METRIC MECH — Shared Design System
   Matches CadNexa's editorial-industrial aesthetic */

:root {
  /* INK & TEXT */
  --ink: #0F172A;             /* deep navy/slate */
  --ink-2: #1E293B;            /* secondary text */
  --ink-3: #334155;            /* tertiary text */
  --mute: #64748B;             /* muted gray-blue */
  --mute-2: #94A3B8;           /* faint gray */

  /* PAPER & SURFACES */
  --paper: #FFFFFF;            /* pure white background */
  --paper-2: #F8FAFC;           /* soft surface */
  --paper-3: #F1F5F9;           /* card hover / subtle */
  --rule: #E2E8F0;              /* default border */
  --rule-strong: #CBD5E1;       /* emphasized border */

  /* BLUEPRINT BLUE — primary accent */
  --blueprint: #2554BA;         /* primary blue */
  --blueprint-d: #1A3D8A;       /* hover/active */
  --blueprint-l: #3A6FD8;       /* lighter shade */
  --blueprint-tint: #EFF4FC;    /* light blue tint for fills */
  --blueprint-tint-2: #DBE5F8;  /* slightly stronger tint */

  /* TEAL — secondary accent (matches CadNexa for cross-brand cohesion) */
  --teal: #0D9488;
  --teal-tint: #ECFDF5;

  /* SEMANTIC */
  --amber: #F59E0B;
  --amber-tint: #FEF3C7;
  --alert: #DC2626;
  --alert-tint: #FEE2E2;
  --ok: #16A34A;
  --ok-tint: #DCFCE7;

  /* TYPOGRAPHY — pure sans, no serif */
  --display: 'Inter', system-ui, -apple-system, sans-serif;
  --body: 'Inter', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* RADII */
  --rad: 6px;
  --rad-lg: 10px;
  --rad-xl: 14px;
  --max-w: 1280px;
  --max-w-prose: 720px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 15.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  letter-spacing: -0.005em;
}
a { color: var(--blueprint); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Blueprint grid — more visible, defines the theme */
.grid-bg {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(rgba(37,84,186,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37,84,186,0.045) 1px, transparent 1px);
  background-size: 24px 24px;
}
main, header, footer, section, article { position: relative; z-index: 2; }

/* Notice bar — keep current blueprint navy */
.notice-bar {
  background: linear-gradient(90deg, #0a1628 0%, #162a45 100%);
  color: #ffffff;
  font-size: 12.5px; padding: 8px 24px; text-align: center;
  letter-spacing: -0.005em;
}
.notice-bar a { color: #74d9b6; text-decoration: underline; text-underline-offset: 3px; font-weight: 500; }
.notice-bar a:hover { color: #14b8a6; }

/* Header — clean white with thin border */
.site-header {
  background: rgba(255,255,255,0.88);
  border-bottom: 1px solid var(--rule);
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(10px);
}
.header-inner {
  max-width: var(--max-w); margin: 0 auto;
  padding: 14px 32px;
  display: flex; align-items: center; justify-content: space-between; gap: 32px;
}
.brand-link { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-link:hover { text-decoration: none; }
.brand-name {
  font-family: var(--display); font-weight: 700; font-size: 19px;
  letter-spacing: -0.02em; color: var(--ink);
}
.brand-name em { font-style: normal; color: var(--blueprint); font-weight: 700; }
.brand-tag {
  font-family: var(--mono); font-size: 9px; color: var(--mute);
  text-transform: uppercase; letter-spacing: 0.14em;
  padding: 3px 8px; border: 1px solid var(--rule-strong); border-radius: 4px;
}
.header-search { flex: 1; max-width: 420px; position: relative; }
.header-search input {
  width: 100%; padding: 9px 14px 9px 36px;
  font-family: var(--body); font-size: 13px;
  border: 1px solid var(--rule); background: var(--paper-2);
  border-radius: var(--rad); outline: none;
  color: var(--ink);
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.header-search input::placeholder { color: var(--mute-2); }
.header-search input:focus {
  border-color: var(--blueprint); background: var(--paper);
  box-shadow: 0 0 0 3px var(--blueprint-tint);
}
.header-search::before {
  content: ''; position: absolute; left: 12px; top: 50%;
  transform: translateY(-50%); width: 14px; height: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-size: contain;
}
.header-nav { display: flex; gap: 6px; font-size: 13.5px; font-weight: 500; }
.header-nav a {
  color: var(--ink-2); text-decoration: none;
  padding: 6px 12px; border-radius: 6px; transition: all 0.15s;
}
.header-nav a:hover { color: var(--blueprint); background: var(--blueprint-tint); text-decoration: none; }
.header-nav a.current { color: var(--blueprint); background: var(--blueprint-tint); font-weight: 600; }

@media (max-width: 980px) {
  .header-inner { flex-wrap: wrap; gap: 14px; }
  .header-search { order: 3; max-width: 100%; }
  .header-nav { gap: 4px; font-size: 12.5px; flex-wrap: wrap; }
  .brand-tag { display: none; }
}

/* Hamburger / mobile drawer · ≤640px */
.mm-menu-toggle { display: none; }
@media (max-width: 640px) {
  .header-inner { padding: 12px 18px; gap: 10px; flex-wrap: wrap; }
  .brand-link { flex: 1; min-width: 0; }
  .mm-menu-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px;
    background: transparent; border: 1px solid var(--rule-strong);
    border-radius: 6px; cursor: pointer; color: var(--ink); padding: 0;
    flex-shrink: 0; order: 2;
  }
  .mm-menu-toggle svg { width: 18px; height: 18px; }
  .header-search { order: 4; flex-basis: 100%; max-width: 100%; }
  .header-nav {
    order: 5; flex-basis: 100%; width: 100%;
    flex-direction: column; gap: 2px;
    max-height: 0; overflow: hidden;
    transition: max-height 0.25s ease;
  }
  .header-nav.open { max-height: 320px; }
  .header-nav a { padding: 10px 12px; font-size: 14px; border-radius: 6px; }
  .brand-name { font-size: 17px; }
}

/* Page header — clean, no big bottom border */
.page-header {
  max-width: var(--max-w); margin: 0 auto;
  padding: 48px 32px 28px;
}
.breadcrumb {
  font-family: var(--mono); font-size: 10.5px; color: var(--mute);
  text-transform: uppercase; letter-spacing: 0.14em; margin-bottom: 14px;
  font-weight: 600;
}
.breadcrumb a { color: var(--mute); }
.breadcrumb a:hover { color: var(--blueprint); }
.breadcrumb .sep { margin: 0 8px; opacity: 0.4; }
.page-title {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.08; letter-spacing: -0.025em;
  color: var(--ink); margin-bottom: 14px;
}
.page-title em { font-style: normal; color: var(--blueprint); font-weight: 700; }
.page-lede {
  font-size: 16.5px; line-height: 1.6;
  color: var(--ink-3); max-width: 680px;
  font-weight: 400;
}

/* Sections */
.section { max-width: var(--max-w); margin: 0 auto; padding: 56px 32px; }
.section-divider { border-bottom: 1px solid var(--rule); }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 24px; padding-bottom: 14px;
  border-bottom: 1px solid var(--rule);
  flex-wrap: wrap; gap: 12px;
}
.section-label {
  font-family: var(--mono); font-size: 10.5px; text-transform: uppercase;
  letter-spacing: 0.14em; color: var(--blueprint);
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 10px;
  font-weight: 600;
}
.section-label::before {
  content: ''; width: 18px; height: 1.5px; background: var(--blueprint);
}
.section-head h2 {
  font-family: var(--display); font-weight: 700; font-size: 26px;
  letter-spacing: -0.025em; color: var(--ink);
}
.section-head h2 em { font-style: normal; color: var(--blueprint); font-weight: 700; }
.all-link {
  font-size: 13px; font-weight: 500; color: var(--blueprint);
  text-decoration: none;
  display: inline-flex; align-items: center; gap: 4px;
}
.all-link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Buttons — flat, modern, blueprint primary */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--body); font-size: 14px; font-weight: 600;
  padding: 10px 18px;
  border: 1px solid var(--blueprint); background: var(--blueprint); color: #fff;
  cursor: pointer; border-radius: var(--rad);
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  letter-spacing: -0.005em; text-decoration: none;
}
.btn:hover { background: var(--blueprint-d); border-color: var(--blueprint-d); text-decoration: none; color: #fff; }
.btn:active { transform: translateY(1px); }
.btn-amber { background: var(--amber); border-color: var(--amber); color: var(--ink); }
.btn-amber:hover { background: #d68a07; border-color: #d68a07; color: var(--ink); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--rule-strong); }
.btn-ghost:hover { background: var(--paper-2); color: var(--ink); border-color: var(--ink-3); }
.btn-lg { font-size: 15px; padding: 13px 22px; }
.btn-sm { font-size: 12px; padding: 7px 14px; }

/* Cards — clean, with subtle blueprint accent */
.card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--rad-lg);
  padding: 22px;
  text-decoration: none; color: inherit; display: block;
  transition: border-color 0.18s, box-shadow 0.18s, transform 0.18s;
  position: relative;
}
.card:hover {
  border-color: var(--blueprint);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 84, 186, 0.08);
  text-decoration: none;
}
.card:hover::after {
  content: ''; position: absolute; top: 12px; right: 12px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--blueprint);
}

/* Tags */
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.1em;
  padding: 3px 8px; background: var(--blueprint-tint); color: var(--blueprint);
  border: 1px solid var(--blueprint-tint-2); border-radius: 4px;
  font-weight: 600;
}

/* CadNexa Promo - Sidebar Card (kept dark; matches CadNexa) */
.cn-promo-card {
  background: linear-gradient(135deg, #0a1628 0%, #162a45 100%);
  color: #fff;
  border-radius: var(--rad-lg);
  padding: 26px 22px;
  position: relative; overflow: hidden;
}
.cn-promo-card::before {
  content: ''; position: absolute;
  top: -60px; right: -60px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(13,148,136,0.18) 0%, transparent 70%);
  pointer-events: none;
}
.cn-promo-card > * { position: relative; }
.cn-promo-eyebrow {
  font-family: var(--mono); font-size: 10px; color: #74d9b6;
  text-transform: uppercase; letter-spacing: 0.14em; margin-bottom: 14px;
  font-weight: 600;
}
.cn-promo-card h3 {
  font-family: var(--display); font-weight: 600;
  font-size: 22px; line-height: 1.2; margin-bottom: 12px;
  letter-spacing: -0.01em; color: var(--paper);
}
.cn-promo-card h3 em { font-style: normal; color: var(--blueprint); font-weight: 700; }
.cn-promo-card p {
  font-size: 14px; line-height: 1.55; margin-bottom: 18px; opacity: 0.85;
}
.cn-promo-cta {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--amber); color: var(--ink);
  font-weight: 600; font-size: 13px; padding: 10px 16px;
  border-radius: var(--rad); text-decoration: none;
  transition: transform 0.15s;
}
.cn-promo-cta:hover { text-decoration: none; color: var(--ink); transform: translateY(-1px); }
.cn-promo-foot {
  font-family: var(--mono); font-size: 10px;
  color: rgba(245,242,236,0.5); text-transform: uppercase; letter-spacing: 0.1em;
  margin-top: 14px; padding-top: 12px;
  border-top: 1px solid rgba(245,242,236,0.1);
}

/* Inline banner */
.cn-inline-banner {
  background: var(--paper);
  border: 1px solid var(--blueprint-tint-2);
  border-left: 3px solid var(--blueprint);
  border-radius: 0 var(--rad) var(--rad) 0;
  padding: 18px 22px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; margin: 32px 0; flex-wrap: wrap;
}
.cn-inline-banner-text { flex: 1; min-width: 280px; }
.cn-inline-banner-text strong {
  font-family: var(--display); font-weight: 700; font-size: 15.5px;
  color: var(--ink); display: block; margin-bottom: 4px;
  letter-spacing: -0.015em;
}
.cn-inline-banner-text strong em { font-style: normal; color: var(--blueprint); font-weight: 700; }
.cn-inline-banner-text span { font-size: 12.5px; color: var(--ink-3); line-height: 1.5; }

/* Big banner */
.cn-big-banner { max-width: var(--max-w); margin: 32px auto; padding: 0 32px; }
.cn-big-banner-inner {
  background: linear-gradient(135deg, #0a1628 0%, #162a45 50%, #0f3a3a 100%);
  color: #ffffff;
  border-radius: var(--rad-lg);
  padding: 44px 48px;
  display: grid; grid-template-columns: 1.1fr 1fr;
  gap: 40px; align-items: center;
  position: relative; overflow: hidden;
}
.cn-big-banner-inner::before {
  content: ''; position: absolute;
  top: -150px; right: -150px;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(13,148,136,0.18) 0%, transparent 65%);
  pointer-events: none;
}
.cn-big-banner-inner::after {
  content: ''; position: absolute;
  bottom: -120px; left: -100px;
  width: 380px; height: 380px;
  background: radial-gradient(circle, rgba(37,84,186,0.14) 0%, transparent 65%);
  pointer-events: none;
}
.cn-big-banner-inner > * { position: relative; z-index: 1; }
.cn-big-eyebrow {
  font-family: var(--mono); font-size: 11px; color: #74d9b6;
  text-transform: uppercase; letter-spacing: 0.14em; margin-bottom: 12px;
  font-weight: 600;
}
.cn-big-banner h2 {
  font-family: var(--display); font-weight: 600; font-size: 30px;
  line-height: 1.15; letter-spacing: -0.01em; margin-bottom: 12px;
}
.cn-big-banner h2 em {
  font-style: normal; font-weight: 700;
  background: linear-gradient(135deg, #3a6fd8, #14b8a6, #74d9b6);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.cn-big-banner p {
  font-size: 15px; line-height: 1.55; color: rgba(255,255,255,0.78); max-width: 560px;
  margin-bottom: 20px;
}
.cn-big-cta {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.cn-big-cta .btn-amber {
  background: linear-gradient(135deg, #2554ba 0%, #0d9488 100%);
  border: none;
  color: #ffffff;
  box-shadow: 0 4px 20px rgba(13,148,136,0.32);
  font-weight: 600;
  transition: transform 0.15s, box-shadow 0.15s;
}
.cn-big-cta .btn-amber:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 28px rgba(13,148,136,0.46);
  color: #ffffff;
}
.cn-big-cta span {
  font-family: var(--mono); font-size: 10px; color: rgba(255,255,255,0.55);
  text-transform: uppercase; letter-spacing: 0.1em;
}

/* Banner preview — stacked CadNexa screenshots */
.cn-big-preview {
  position: relative;
  height: 280px;
  perspective: 1000px;
}
.cn-big-preview img {
  position: absolute;
  width: 86%;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.08);
  display: block;
  object-fit: cover;
  height: 70%;
}
.cn-big-preview img:first-child {
  top: 0; left: 0;
  transform: rotate(-2deg);
  z-index: 1;
}
.cn-big-preview img.cn-big-preview-stack {
  bottom: 0; right: 0;
  transform: rotate(2deg);
  z-index: 2;
}

@media (max-width: 800px) {
  .cn-big-banner-inner { grid-template-columns: 1fr; padding: 32px 28px; gap: 24px; }
  .cn-big-cta { flex-direction: column; align-items: flex-start; }
  .cn-big-preview { height: 220px; order: -1; }
  .cn-big-preview img { height: 65%; }
}
@media (max-width: 500px) {
  .cn-big-preview { display: none; }
}

/* Footer */
.site-footer {
  background: linear-gradient(135deg, #0a1628 0%, #0f1f35 100%);
  color: rgba(255,255,255,0.65);
  padding: 56px 32px 26px;
  font-size: 13px; margin-top: 64px;
}
.footer-inner {
  max-width: var(--max-w); margin: 0 auto;
  display: grid; grid-template-columns: 1.8fr 1fr 1fr 1fr 1fr;
  gap: 36px;
  padding-bottom: 32px; border-bottom: 1px solid rgba(255,255,255,0.06);
}
.footer-brand {
  font-family: var(--display); font-size: 19px; font-weight: 700;
  color: #fff; margin-bottom: 10px; letter-spacing: -0.02em;
}
.footer-brand em { font-style: normal; color: #74d9b6; font-weight: 700; }
.footer-about { font-size: 13px; line-height: 1.6; margin-bottom: 16px; color: rgba(255,255,255,0.6); }
.footer-supported {
  font-family: var(--mono); font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: rgba(255,255,255,0.4);
  font-weight: 600;
}
.footer-supported a { color: #74d9b6; text-decoration: none; font-weight: 600; }
.footer-col h5 {
  font-family: var(--mono); font-size: 10.5px;
  text-transform: uppercase; letter-spacing: 0.14em;
  color: #74d9b6; margin-bottom: 14px; font-weight: 600;
}
.footer-col a {
  display: block; padding: 4px 0;
  color: rgba(255,255,255,0.65);
  font-size: 13px; text-decoration: none;
}
.footer-col a:hover { color: #fff; text-decoration: underline; }
.footer-bottom {
  max-width: var(--max-w); margin: 0 auto;
  padding-top: 22px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  font-family: var(--mono); font-size: 10.5px;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: rgba(255,255,255,0.4);
  font-weight: 500;
}
@media (max-width: 900px) { .footer-inner { grid-template-columns: 1fr 1fr; } }

/* Animations */
.fade-up {
  opacity: 0; transform: translateY(20px);
  animation: fadeUp 0.6s ease forwards;
}
.fade-up.d1 { animation-delay: 0.08s; }
.fade-up.d2 { animation-delay: 0.16s; }
.fade-up.d3 { animation-delay: 0.24s; }
@keyframes fadeUp { to { opacity: 1; transform: translateY(0); } }

/* Common grids */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid-3, .grid-4, .grid-2 { grid-template-columns: 1fr; } }

/* Calculator card icon */
.icon-32 { width: 32px; height: 32px; color: var(--amber); margin-bottom: 14px; }
.icon-32 svg { width: 100%; height: 100%; }

/* Article styling */
.article-prose {
  max-width: var(--max-w-prose);
  font-family: var(--display);
  font-size: 18px;
  line-height: 1.65;
  color: var(--ink-2);
}
.article-prose h2 {
  font-family: var(--display); font-weight: 600; font-size: 28px;
  letter-spacing: -0.01em; color: var(--ink);
  margin-top: 40px; margin-bottom: 16px;
  line-height: 1.2;
}
.article-prose h3 {
  font-family: var(--display); font-weight: 600; font-size: 22px;
  letter-spacing: -0.01em; color: var(--ink);
  margin-top: 32px; margin-bottom: 12px;
}
.article-prose p { margin-bottom: 18px; }
.article-prose ul, .article-prose ol { margin: 0 0 18px 24px; }
.article-prose li { margin-bottom: 8px; }
.article-prose strong { color: var(--ink); font-weight: 600; }
.article-prose em { font-style: italic; }
.article-prose code {
  font-family: var(--mono); font-size: 14px;
  background: var(--paper-2); padding: 2px 6px;
  border-radius: var(--rad);
}
.article-prose blockquote {
  border-left: 3px solid var(--amber);
  padding: 8px 0 8px 20px;
  margin: 24px 0;
  font-style: italic;
  color: var(--ink-2);
}

/* Table styles */
.ref-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--body);
  font-size: 14px;
  margin: 20px 0;
}
.ref-table th {
  background: var(--ink); color: var(--paper);
  font-family: var(--mono); font-size: 11px;
  font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 10px 12px; text-align: left;
}
.ref-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}
.ref-table tr:nth-child(even) td { background: var(--paper-2); }

/* Form inputs for calculators */
.calc-input {
  width: 100%; padding: 10px 14px;
  font-family: var(--mono); font-size: 14px;
  border: 1px solid var(--rule-strong);
  background: var(--paper);
  border-radius: var(--rad); outline: none;
  transition: border-color 0.2s;
}
.calc-input:focus { border-color: var(--blueprint); }
.calc-label {
  font-family: var(--body); font-size: 13px;
  font-weight: 500; color: var(--ink-2);
  display: block; margin-bottom: 6px;
}
.calc-result {
  background: var(--ink); color: var(--paper);
  padding: 24px; border-radius: var(--rad-lg);
  font-family: var(--mono);
}
.calc-result-label {
  font-size: 11px; color: var(--amber);
  text-transform: uppercase; letter-spacing: 0.12em;
  margin-bottom: 8px;
}
.calc-result-value {
  font-family: var(--display); font-size: 36px;
  font-weight: 600; letter-spacing: -0.02em;
}

/* ========== Sticky Scroll CTA ========== */
.mm-sticky-cta {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 320px;
  background: linear-gradient(135deg, #0a1628 0%, #162a45 100%);
  color: #ffffff;
  border-radius: var(--rad-lg);
  padding: 18px 20px 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.28), 0 0 0 1px rgba(13,148,136,0.32);
  z-index: 1000;
  font-family: var(--body);
  transform: translateY(140%);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s;
  border-left: 3px solid #0d9488;
  overflow: hidden;
}
.mm-sticky-cta::before {
  content: ''; position: absolute;
  top: -80px; right: -80px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(13,148,136,0.18) 0%, transparent 70%);
  pointer-events: none;
}
.mm-sticky-cta > * { position: relative; z-index: 1; }
.mm-sticky-cta.mm-sticky-show {
  transform: translateY(0);
  opacity: 1;
}

/* Variant with calculator preview image */
.mm-sticky-cta.mm-sticky-with-img {
  display: flex;
  align-items: stretch;
  padding: 0;
  width: 380px;
}
.mm-sticky-cta.mm-sticky-with-img .mm-sticky-thumb {
  flex-shrink: 0;
  width: 100px;
  background-size: cover;
  background-position: center;
  border-right: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--rad-lg) 0 0 var(--rad-lg);
}
.mm-sticky-cta.mm-sticky-with-img .mm-sticky-content {
  flex: 1; padding: 16px 18px 14px;
  min-width: 0;
}

.mm-sticky-close {
  position: absolute;
  top: 6px;
  right: 8px;
  background: transparent;
  border: 0;
  color: rgba(255,255,255,0.5);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  font-family: var(--body);
  z-index: 2;
}
.mm-sticky-close:hover { color: #ffffff; }
.mm-sticky-eyebrow {
  font-family: var(--mono);
  font-size: 9px;
  color: #74d9b6;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-bottom: 6px;
  font-weight: 600;
}
.mm-sticky-title {
  font-family: var(--display);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 5px;
  letter-spacing: -0.01em;
}
.mm-sticky-sub {
  font-size: 12px;
  line-height: 1.4;
  color: rgba(255,255,255,0.75);
  margin-bottom: 10px;
}
.mm-sticky-cta-btn {
  display: inline-block;
  background: linear-gradient(135deg, #2554ba 0%, #0d9488 100%);
  color: #ffffff;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: var(--rad);
  font-family: var(--body);
  font-size: 12px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0.01em;
  box-shadow: 0 2px 12px rgba(13,148,136,0.32);
  transition: transform 0.15s, box-shadow 0.15s;
}
.mm-sticky-cta-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 18px rgba(13,148,136,0.46);
  color: #ffffff;
}

/* Mobile: thinner, full width, lower priority */
@media (max-width: 600px) {
  .mm-sticky-cta {
    bottom: 8px;
    right: 8px;
    left: 8px;
    width: auto;
    max-width: none;
    padding: 12px 14px 12px;
  }
  .mm-sticky-cta.mm-sticky-with-img .mm-sticky-thumb {
    width: 70px;
    border-radius: var(--rad-lg) 0 0 var(--rad-lg);
  }
  .mm-sticky-cta.mm-sticky-with-img .mm-sticky-content {
    padding: 10px 14px 10px;
  }
  .mm-sticky-title { font-size: 14px; }
  .mm-sticky-sub { font-size: 11px; margin-bottom: 8px; -webkit-line-clamp: 2; display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
  .mm-sticky-cta-btn { font-size: 11px; padding: 7px 12px; }
}

/* "From 3D model" contextual CTA — uses CadNexa's actual brand palette */
.cn-3d-cta {
  display: flex; align-items: stretch; gap: 0;
  margin: 24px 0;
  max-width: var(--max-w);
  margin-left: auto; margin-right: auto;
  background: linear-gradient(135deg, #2554ba 0%, #0d9488 55%, #14b8a6 100%);
  color: #ffffff;
  border-radius: 14px;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 18px rgba(13,148,136,0.22);
  min-height: 110px;
}
.cn-3d-cta::before {
  content: '';
  position: absolute;
  top: -60%; right: -10%;
  width: 280px; height: 280px;
  background: radial-gradient(circle, rgba(116,217,182,0.18) 0%, transparent 65%);
  pointer-events: none;
  z-index: 1;
}
.cn-3d-cta:hover {
  transform: translateY(-2px);
  text-decoration: none; color: #ffffff;
  box-shadow: 0 10px 30px rgba(13,148,136,0.38);
}

/* Image preview — actual CadNexa screenshot */
.cn-3d-cta-img {
  flex-shrink: 0;
  width: 140px;
  background-size: cover;
  background-position: center;
  position: relative;
  z-index: 2;
  border-right: 1px solid rgba(255,255,255,0.08);
}
.cn-3d-cta-img::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 60%, rgba(13,148,136,0.18) 100%);
  pointer-events: none;
}

/* Body content */
.cn-3d-cta-body {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  position: relative;
  z-index: 2;
  min-width: 0;
}
.cn-3d-cta-icon {
  flex-shrink: 0;
  width: 44px; height: 44px;
  background: linear-gradient(135deg, #74d9b6, #14b8a6);
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  color: #0a1628;
  box-shadow: 0 2px 10px rgba(116,217,182,0.32);
}
.cn-3d-cta-text { flex: 1; min-width: 0; }
.cn-3d-cta-text strong {
  display: block;
  font-family: 'Inter Tight', system-ui, sans-serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.2px;
  margin-bottom: 3px;
  color: #ffffff;
  line-height: 1.3;
}
.cn-3d-cta-text strong em {
  font-style: italic;
  color: #74d9b6;
  font-weight: 600;
}
.cn-3d-cta-text span {
  display: block;
  font-size: 13px;
  color: rgba(255,255,255,0.82);
  line-height: 1.45;
  font-weight: 400;
}
.cn-3d-cta-arrow {
  flex-shrink: 0;
  font-family: var(--mono);
  font-size: 11px;
  color: #ffffff;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  white-space: nowrap;
  padding: 8px 14px;
  background: rgba(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.24);
  border-radius: 8px;
  transition: background 0.15s;
}
.cn-3d-cta:hover .cn-3d-cta-arrow {
  background: rgba(255,255,255,0.26);
  border-color: rgba(255,255,255,0.4);
}

/* Mobile: image becomes top banner, text below */
@media (max-width: 700px) {
  .cn-3d-cta { flex-direction: column; min-height: auto; }
  .cn-3d-cta-img { width: 100%; height: 130px; border-right: none; border-bottom: 1px solid rgba(255,255,255,0.08); }
  .cn-3d-cta-img::after { background: linear-gradient(180deg, transparent 60%, rgba(13,148,136,0.22) 100%); }
  .cn-3d-cta-body { flex-wrap: wrap; padding: 16px 18px; gap: 12px; }
  .cn-3d-cta-arrow { width: 100%; text-align: center; padding: 9px 14px; }
}


/* ════════════════════════════════════════════
   RIGHT-RAIL CTA — lives in the dead space outside content
   Only shows on wide desktops (>1500px). Stays fixed in viewport.
   Never overlaps content because content max-width is 1280px,
   and rail anchors itself to the right gutter.
   ════════════════════════════════════════════ */
.mm-rail {
  position: fixed;
  top: 110px;
  right: 16px;
  width: 180px;
  z-index: 90;
  display: none; /* hidden by default; shown on truly wide screens via media query */
  background: linear-gradient(135deg, #0a1628 0%, #162a45 100%);
  border-radius: 12px;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,0.16), 0 0 0 1px rgba(13,148,136,0.22);
  text-decoration: none;
  color: #ffffff;
  transition: transform 0.2s, box-shadow 0.2s;
}
.mm-rail::before {
  content: ''; position: absolute;
  top: -50px; right: -50px;
  width: 140px; height: 140px;
  background: radial-gradient(circle, rgba(13,148,136,0.22) 0%, transparent 70%);
  pointer-events: none;
}
.mm-rail:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(13,148,136,0.32), 0 0 0 1px rgba(13,148,136,0.4);
  text-decoration: none;
  color: #ffffff;
}
.mm-rail-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  background-size: cover;
  background-position: center;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  position: relative;
}
.mm-rail-img::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(10,22,40,0.5) 100%);
  pointer-events: none;
}
.mm-rail-body {
  padding: 11px 13px 13px;
  position: relative; z-index: 2;
}
.mm-rail-eyebrow {
  font-family: var(--mono);
  font-size: 8.5px;
  color: #74d9b6;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
  margin-bottom: 5px;
}
.mm-rail-title {
  font-family: var(--display);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.005em;
  margin-bottom: 5px;
  color: #ffffff;
}
.mm-rail-title em {
  font-style: italic;
  color: #74d9b6;
  font-weight: 500;
}
.mm-rail-sub {
  font-size: 10.5px;
  line-height: 1.4;
  color: rgba(255,255,255,0.72);
  margin-bottom: 9px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.mm-rail-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  background: linear-gradient(135deg, #2554ba, #0d9488);
  color: #ffffff;
  border-radius: 5px;
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  box-shadow: 0 2px 8px rgba(13,148,136,0.32);
}
.mm-rail-foot {
  font-family: var(--mono);
  font-size: 8.5px;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 7px;
}

/* CRITICAL: only show rails on screens with genuine dead space.
   Content is 1280px wide + ~16px scrollbar.
   Each rail = 180 + 16 margin = 196px.
   To show BOTH rails without overlap: 1280 + 196*2 = 1672px minimum.
   Set threshold safely above that. */
@media (min-width: 1720px) {
  .mm-rail { display: block; }
}

/* Hide rails when sticky CTA appears */
.mm-rail.mm-rail-sticky-active { display: none !important; }


/* LEFT-rail variant — mirrors right rail on opposite side */
.mm-rail-left {
  position: fixed;
  top: 110px;
  left: 16px;
  right: auto;
  width: 180px;
  z-index: 90;
  display: none;
  background: linear-gradient(135deg, #0a1628 0%, #162a45 100%);
  border-radius: 12px;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,0.16), 0 0 0 1px rgba(37,84,186,0.22);
  text-decoration: none;
  color: #ffffff;
  transition: transform 0.2s, box-shadow 0.2s;
  border-right: 3px solid #2554ba;
}
.mm-rail-left::before {
  content: ''; position: absolute;
  top: -50px; left: -50px;
  width: 140px; height: 140px;
  background: radial-gradient(circle, rgba(37,84,186,0.22) 0%, transparent 70%);
  pointer-events: none;
}
.mm-rail-left:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(37,84,186,0.32), 0 0 0 1px rgba(37,84,186,0.4);
  text-decoration: none;
  color: #ffffff;
}
@media (min-width: 1720px) {
  .mm-rail-left { display: block; }
}
.mm-rail-left.mm-rail-sticky-active { display: none !important; }


/* ════════════════════════════════════════════
   PWA INSTALL PILL — floating, non-intrusive
   Positions BOTTOM-LEFT (sticky CTA is bottom-right, rails on sides)
   ════════════════════════════════════════════ */
.mm-install-pill {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 1001;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px 10px 12px;
  background: linear-gradient(135deg, #0a1628 0%, #162a45 100%);
  color: #fff;
  border-radius: 100px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.28), 0 0 0 1px rgba(13,148,136,0.32);
  border-left: 3px solid #74d9b6;
  transform: translateY(140%);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s;
  font-family: var(--body);
  max-width: 360px;
}
.mm-install-pill.mm-install-show {
  transform: translateY(0);
  opacity: 1;
}
.mm-install-icon {
  flex-shrink: 0;
  width: 36px; height: 36px;
  background: linear-gradient(135deg, #74d9b6, #14b8a6);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #0a1628;
}
.mm-install-text { flex: 1; min-width: 0; }
.mm-install-text strong {
  display: block;
  font-family: var(--display);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.15;
  margin-bottom: 1px;
}
.mm-install-text span {
  display: block;
  font-size: 11px;
  color: rgba(255,255,255,0.7);
  line-height: 1.3;
}
.mm-install-btn {
  flex-shrink: 0;
  background: linear-gradient(135deg, #2554ba, #0d9488);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 100px;
  font-family: var(--body);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 2px 10px rgba(13,148,136,0.32);
}
.mm-install-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(13,148,136,0.48);
}
.mm-install-close {
  position: absolute;
  top: -8px; left: -8px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #fff;
  color: #0a1628;
  border: 1px solid rgba(0,0,0,0.1);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  font-family: var(--body);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.mm-install-close:hover { background: #f0f0f0; }

/* Mobile: full-width at bottom, slimmer */
@media (max-width: 600px) {
  .mm-install-pill {
    left: 8px; right: 8px; bottom: 8px;
    max-width: none;
    padding: 8px 12px 8px 10px;
  }
  .mm-install-text strong { font-size: 12.5px; }
  .mm-install-text span { font-size: 10.5px; }
  .mm-install-btn { padding: 7px 12px; font-size: 11px; }
  .mm-install-icon { width: 32px; height: 32px; }
}

/* Avoid stacking with other CTAs at bottom */
@media (max-width: 600px) {
  /* When sticky CTA shows, push install pill up */
  .mm-sticky-cta.mm-sticky-show ~ .mm-install-pill,
  body:has(.mm-sticky-cta.mm-sticky-show) .mm-install-pill {
    bottom: 90px;
  }
}

/* INSTALL INSTRUCTIONS MODAL (iOS / Firefox / Safari Mac) */
.mm-install-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(10, 22, 40, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.25s;
}
.mm-install-modal.mm-install-modal-show { opacity: 1; }
.mm-install-modal-card {
  background: var(--paper, #fff);
  color: var(--ink, #1a1f2e);
  border-radius: 14px;
  max-width: 420px;
  width: 100%;
  padding: 28px 28px 24px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  font-family: var(--body);
  transform: translateY(20px);
  transition: transform 0.25s;
}
.mm-install-modal.mm-install-modal-show .mm-install-modal-card { transform: translateY(0); }
.mm-install-modal-close {
  position: absolute;
  top: 12px; right: 12px;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: rgba(0,0,0,0.05);
  color: var(--ink, #1a1f2e);
  border: none;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  display: flex; align-items: center; justify-content: center;
}
.mm-install-modal-close:hover { background: rgba(0,0,0,0.1); }
.mm-install-modal-icon {
  margin-bottom: 16px;
}
.mm-install-modal-icon img {
  width: 64px; height: 64px;
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(13,148,136,0.22);
}
.mm-install-modal h3 {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 14px;
  color: var(--ink, #1a1f2e);
}
.mm-install-modal ol, .mm-install-modal p {
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink-2, #4a5163);
  margin-bottom: 12px;
}
.mm-install-modal ol { padding-left: 22px; }
.mm-install-modal ol li { margin-bottom: 8px; }
.mm-install-modal strong {
  color: var(--ink, #1a1f2e);
  font-weight: 600;
}
.mm-install-modal-foot {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--rule, #e5e0d6);
  font-size: 12.5px;
  color: var(--mute, #7a7468);
}
