/**
 * FRONTEND PROMPT 5 — Features page (/features/)
 * Scoped: body.mg-public .feat-*
 */

body.mg-public {
  --feat-nav-h: 52px;
}

/* ── Compact hero ───────────────────────────────────────────── */
body.mg-public .feat-page-hero {
  position: relative;
  height: auto;
  min-height: clamp(20rem, 48vh, 28rem);
  max-height: none;
  padding-block: clamp(3rem, 6vw, 5rem);
  background: linear-gradient(180deg, #f8fafb 0%, #ffffff 55%, #f0f7f4 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-bottom: 1px solid var(--border-light);
}

body.mg-public .feat-page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 1px 1px, rgba(10, 22, 40, 0.04) 1px, transparent 0);
  background-size: 32px 32px;
  pointer-events: none;
}

body.mg-public .feat-page-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 55% 55% at 85% 85%, rgba(10, 111, 163, 0.08) 0%, transparent 55%),
    radial-gradient(ellipse 45% 45% at 10% 15%, rgba(29, 78, 216, 0.06) 0%, transparent 55%);
  pointer-events: none;
}

body.mg-public .feat-page-hero-inner {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 820px;
  padding: 40px 24px;
}

body.mg-public .feat-page-hero .section-label {
  justify-content: center;
  margin-bottom: 16px;
  color: var(--teal-600);
}

body.mg-public .feat-page-hero h1 {
  color: var(--navy-900) !important;
  font-size: clamp(32px, 4.5vw, 52px);
  margin-bottom: 20px;
}

body.mg-public .feat-page-hero .feat-hero-lead {
  color: var(--text-secondary);
  font-size: 17px;
  line-height: 1.65;
  max-width: 62ch;
  margin: 0 auto;
}

/* ── Sticky nav ─────────────────────────────────────────────── */
body.mg-public .feat-sticky-nav-wrap {
  position: sticky;
  top: var(--mg-navbar-height, 88px);
  z-index: 990;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  box-shadow: 0 4px 16px rgba(10, 22, 40, 0.04);
}

body.mg-public .feat-sticky-nav {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  overflow-x: auto;
  padding: 0 4px;
  min-height: var(--feat-nav-h);
  align-items: stretch;
  scrollbar-width: thin;
}

body.mg-public .feat-sticky-nav::-webkit-scrollbar {
  height: 4px;
}

body.mg-public .feat-nav-link {
  flex: 1 1 auto;
  text-align: center;
  padding: 14px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

body.mg-public .feat-nav-link:hover {
  color: var(--navy-900);
}

body.mg-public .feat-nav-link.is-active {
  color: var(--teal-600);
  border-bottom-color: var(--teal-500);
}

/* ── Feature sections ──────────────────────────────────────── */
body.mg-public .feat-section {
  scroll-margin-top: calc(var(--mg-navbar-height, 88px) + var(--feat-nav-h) + 12px);
  padding: var(--section-py) 0;
}

body.mg-public .feat-section-head {
  margin-bottom: 40px;
}

body.mg-public .feat-section-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 5vw, 56px);
  align-items: center;
  margin-bottom: 48px;
}

@media (max-width: 991px) {
  body.mg-public .feat-section-layout {
    grid-template-columns: 1fr;
  }

  body.mg-public .feat-section-layout.feat-section-layout--flip .feat-section-visual {
    order: -1;
  }
}

body.mg-public .feat-section-intro .section-label {
  margin-bottom: 12px;
}

body.mg-public .feat-section-intro h2 {
  font-size: clamp(26px, 3.2vw, 38px);
  margin-bottom: 16px;
}

body.mg-public .feat-section-intro p {
  color: var(--text-secondary);
  font-size: 17px;
  line-height: 1.65;
  max-width: 52ch;
}

body.mg-public .feat-section--white {
  background: #fff;
}

body.mg-public .feat-section--light {
  background: var(--bg-light);
}

body.mg-public .feat-section--dark {
  background: var(--navy-900);
  position: relative;
  overflow: hidden;
}

body.mg-public .feat-section--dark::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.04) 1px, transparent 0);
  background-size: 28px 28px;
  pointer-events: none;
}

body.mg-public .feat-section--dark .feat-section-inner {
  position: relative;
  z-index: 1;
}

body.mg-public .feat-section--dark .feat-section-intro h2,
body.mg-public .feat-section--dark .feat-section-intro .section-label-white {
  color: #fff;
}

body.mg-public .feat-section--dark .feat-section-intro p {
  color: rgba(255, 255, 255, 0.68);
}

body.mg-public .feat-section--dark .section-label-white::before {
  background: rgba(255, 255, 255, 0.35);
}

/* Phase diagram */
body.mg-public .feat-phase-diagram {
  padding: 16px;
}

body.mg-public .feat-phase-track {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 4px;
  position: relative;
  padding-top: 8px;
}

body.mg-public .feat-phase-track::before {
  content: "";
  position: absolute;
  top: 36px;
  left: 8%;
  right: 8%;
  height: 4px;
  background: rgba(10, 22, 40, 0.08);
  border-radius: 2px;
  z-index: 0;
}

body.mg-public .feat-phase-track-fill {
  position: absolute;
  top: 36px;
  left: 8%;
  width: 0;
  max-width: 84%;
  height: 4px;
  background: linear-gradient(90deg, var(--teal-500), var(--teal-300));
  border-radius: 2px;
  z-index: 1;
  animation: featPhaseFill 2.2s ease forwards 0.4s;
}

@keyframes featPhaseFill {
  to {
    width: 72%;
  }
}

body.mg-public .feat-phase-node {
  position: relative;
  z-index: 2;
  flex: 1;
  text-align: center;
  max-width: 72px;
}

body.mg-public .feat-phase-track--seven .feat-phase-node {
  max-width: 64px;
}

body.mg-public .feat-phase-track--seven .feat-phase-ring {
  width: 44px;
  height: 44px;
  font-size: 14px;
}

body.mg-public .feat-phase-track--seven .feat-phase-name {
  font-size: 8px;
  letter-spacing: 0.04em;
}

body.mg-public .feat-phase-track--seven .feat-phase-track-fill {
  animation-name: featPhaseFillSeven;
}

@keyframes featPhaseFillSeven {
  to {
    width: 92%;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.mg-public .feat-phase-track--seven .feat-phase-track-fill {
    animation: none;
    width: 92%;
  }
}

body.mg-public .feat-phase-ring {
  width: 56px;
  height: 56px;
  margin: 0 auto 10px;
  border-radius: 50%;
  background: var(--bg-light);
  border: 3px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--teal-600);
}

body.mg-public .feat-phase-node.is-complete .feat-phase-ring {
  border-color: var(--teal-400);
  background: rgba(10, 111, 163, 0.12);
}

body.mg-public .feat-phase-node.is-active .feat-phase-ring {
  border-color: var(--gold-400);
  background: rgba(224, 168, 32, 0.15);
  color: var(--gold-500);
}

body.mg-public .feat-phase-name {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  line-height: 1.25;
}

body.mg-public .feat-phase-node.is-complete .feat-phase-name {
  color: var(--teal-600);
}

body.mg-public .feat-phase-node.is-active .feat-phase-name {
  color: var(--gold-500);
}

@media (prefers-reduced-motion: reduce) {
  body.mg-public .feat-phase-track-fill {
    animation: none;
    width: 72%;
  }
}

/* Sub-feature grid */
body.mg-public .feat-subgrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}

@media (max-width: 767px) {
  body.mg-public .feat-subgrid {
    grid-template-columns: 1fr;
  }
}

body.mg-public .feat-subgrid li {
  font-size: 14px;
  color: var(--text-secondary);
  padding-left: 0;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

body.mg-public .feat-subgrid .feat-check {
  color: var(--teal-500);
  flex-shrink: 0;
}

body.mg-public .feat-section--dark .feat-subgrid li {
  color: rgba(255, 255, 255, 0.75);
}

body.mg-public .feat-section--dark .feat-subgrid.feat-subgrid--gold .feat-check {
  color: var(--gold-400);
}

body.mg-public .feat-section--dark .feat-subgrid.feat-subgrid--gold li {
  color: var(--gold-100);
}

/* Grant intelligence section — dense two-panel layout */
body.mg-public .feat-grant-section {
  display: grid;
  grid-template-columns: minmax(260px, 0.95fr) minmax(320px, 1.05fr);
  gap: 20px;
  align-items: stretch;
  margin-bottom: 48px;
}

@media (max-width: 991px) {
  body.mg-public .feat-grant-section {
    grid-template-columns: 1fr;
  }
}

body.mg-public .feat-grant-intro-card {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 28px 28px 24px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 0;
}

body.mg-public .feat-grant-intro-card h2 {
  font-size: clamp(24px, 2.8vw, 34px);
  margin-bottom: 14px;
}

body.mg-public .feat-grant-intro-card p {
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.65;
  margin-bottom: 0;
}

body.mg-public .feat-grant-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: auto;
  padding-top: 22px;
  border-top: 1px solid var(--border-light);
}

body.mg-public .feat-grant-stat {
  background: var(--bg-light);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 12px 10px;
  text-align: center;
}

body.mg-public .feat-grant-stat strong {
  display: block;
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--teal-600);
  line-height: 1.2;
}

body.mg-public .feat-grant-stat span {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  line-height: 1.3;
}

body.mg-public .feat-grant-panel {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

body.mg-public .feat-grant-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: linear-gradient(180deg, #f8fafb 0%, #fff 100%);
  border-bottom: 1px solid var(--border-light);
}

body.mg-public .feat-grant-panel-eyebrow {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  line-height: 1.3;
}

body.mg-public .feat-grant-panel-title {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
}

body.mg-public .feat-grant-count-pill {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 100px;
  background: rgba(10, 111, 163, 0.12);
  color: var(--teal-600);
  border: 1px solid rgba(10, 111, 163, 0.22);
}

body.mg-public .feat-grant-list {
  display: flex;
  flex-direction: column;
}

body.mg-public .feat-grant-card {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-light);
  background: #fff;
}

body.mg-public .feat-grant-card:last-child {
  border-bottom: none;
}

body.mg-public .feat-grant-card-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

body.mg-public .feat-grant-match-ring {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 3px solid;
  line-height: 1;
}

body.mg-public .feat-grant-match-ring.ring-success {
  border-color: var(--teal-500);
  background: rgba(10, 111, 163, 0.1);
}

body.mg-public .feat-grant-match-ring.ring-warning {
  border-color: #d97706;
  background: #fffbeb;
}

body.mg-public .feat-grant-match-value {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--navy-900);
}

body.mg-public .feat-grant-match-label {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

body.mg-public .feat-grant-card-body {
  flex: 1;
  min-width: 0;
}

body.mg-public .feat-grant-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

body.mg-public .feat-grant-title {
  margin: 0;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.35;
}

body.mg-public .feat-grant-status {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

body.mg-public .feat-grant-status--ok {
  background: rgba(10, 111, 163, 0.12);
  color: var(--teal-600);
}

body.mg-public .feat-grant-status--warn {
  background: #fff7ed;
  color: #c2410c;
}

body.mg-public .feat-grant-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 12px;
  color: var(--text-secondary);
}

body.mg-public .feat-grant-meta-row span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

body.mg-public .feat-grant-meta-row i {
  color: var(--text-muted);
  font-size: 13px;
}

body.mg-public .feat-grant-meta-funding {
  color: var(--teal-600);
  font-weight: 600;
}

body.mg-public .feat-grant-meta-funding i {
  color: var(--teal-500);
}

@media (max-width: 575px) {
  body.mg-public .feat-grant-stats {
    grid-template-columns: 1fr;
  }

  body.mg-public .feat-grant-stat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    gap: 12px;
  }

  body.mg-public .feat-grant-stat strong {
    font-size: 16px;
  }

  body.mg-public .feat-grant-stat span {
    margin-top: 0;
    text-align: right;
  }
}

/* AI chat mock */
body.mg-public .feat-ai-chat {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  padding: 20px;
  max-width: 440px;
  margin-inline-start: auto;
}

@media (max-width: 991px) {
  body.mg-public .feat-ai-chat {
    margin-inline-start: 0;
    max-width: none;
  }
}

body.mg-public .feat-ai-chat-user {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 12px 12px 12px 4px;
  padding: 12px 14px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 12px;
}

body.mg-public .feat-ai-chat-ai {
  background: rgba(10, 111, 163, 0.18);
  border: 1px solid rgba(10, 111, 163, 0.35);
  border-radius: 12px 12px 4px 12px;
  padding: 14px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.55;
}

body.mg-public .feat-ai-chat-ai strong {
  color: var(--teal-300);
}

/* Analytics mock */
body.mg-public .feat-dash-mock {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-float);
}

body.mg-public .feat-dash-head {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

body.mg-public .feat-dash-body {
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

body.mg-public .feat-dash-kpi {
  background: var(--bg-light);
  border-radius: var(--radius-sm);
  padding: 12px;
}

body.mg-public .feat-dash-kpi-num {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 600;
  color: var(--navy-900);
}

body.mg-public .feat-dash-kpi-label {
  font-size: 11px;
  color: var(--text-muted);
}

body.mg-public .feat-dash-chart {
  grid-column: 1 / -1;
  height: 120px;
  background: linear-gradient(180deg, rgba(10, 111, 163, 0.08) 0%, transparent 100%);
  border-radius: var(--radius-sm);
  position: relative;
  overflow: hidden;
}

body.mg-public .feat-dash-chart::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--teal-400) 10%,
    var(--teal-400) 90%,
    transparent 100%
  );
  opacity: 0.35;
  clip-path: polygon(0 85%, 12% 55%, 28% 65%, 42% 35%, 58% 48%, 72% 22%, 88% 38%, 100% 18%, 100% 100%, 0 100%);
}

/* Exports mock */
body.mg-public .feat-export-mock {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  justify-content: center;
  flex-wrap: wrap;
}

body.mg-public .feat-export-doc {
  width: 100px;
  height: 130px;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}

body.mg-public .feat-export-doc.is-primary {
  transform: translateY(-12px);
  border-color: var(--teal-300);
  box-shadow: var(--shadow-float);
}

body.mg-public .feat-export-icon {
  width: 36px;
  height: 44px;
  border-radius: 4px;
  background: var(--teal-50);
  border: 1px solid rgba(10, 111, 163, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--teal-600);
  font-size: 20px;
}

/* Security mock */
body.mg-public .feat-sec-mock {
  background: var(--bg-light);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 32px;
  text-align: center;
}

body.mg-public .feat-sec-shield {
  width: 88px;
  height: 88px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(10, 111, 163, 0.25), rgba(10, 22, 40, 0.08));
  border: 2px solid rgba(10, 111, 163, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
}

body.mg-public .feat-sec-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

body.mg-public .feat-sec-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 100px;
  background: #fff;
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
}

/* Bottom CTA (match homepage banner) */
body.mg-public .feat-page-cta {
  background: linear-gradient(135deg, #0a5a85 0%, #0a6fa3 100%);
  padding: 80px 0;
  text-align: center;
}

body.mg-public .feat-page-cta h2 {
  color: #fff;
  font-size: clamp(28px, 4vw, 44px);
  margin-bottom: 16px;
}

body.mg-public .feat-page-cta .feat-page-cta-sub {
  color: rgba(255, 255, 255, 0.7);
  max-width: 52ch;
  margin: 0 auto 28px;
  font-size: 17px;
  line-height: 1.65;
}

body.mg-public .feat-page-cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
}

body.mg-public .feat-page-cta .home-cta-btn-solid {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 16px 32px;
  border-radius: 100px;
  font-weight: 600;
  font-size: 16px;
  background: #fff;
  color: var(--navy-900);
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

body.mg-public .feat-page-cta .home-cta-btn-solid:hover {
  color: var(--navy-900);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
}

body.mg-public .feat-page-cta .home-cta-btn-primary {
  background: #fff;
  color: var(--navy-900);
}

body.mg-public .feat-page-cta .home-cta-btn-primary:hover {
  color: var(--navy-900);
  background: #f8fafb;
}

body.mg-public .feat-cta-secondary {
  display: inline-flex;
  align-items: center;
  padding: 16px 28px;
  border-radius: 100px;
  font-weight: 600;
  font-size: 16px;
  color: #fff;
  text-decoration: none;
  border: 2px solid rgba(255, 255, 255, 0.75);
  background: transparent;
  transition: background 0.2s ease, border-color 0.2s ease;
}

body.mg-public .feat-cta-secondary:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border-color: #fff;
}

body.mg-public .feat-page-cta .btn-outline-white {
  padding: 16px 32px;
}

body.mg-public .feat-page-cta-schedule {
  margin-top: 16px;
}

body.mg-public .feat-page-cta-schedule a {
  color: rgba(255, 255, 255, 0.85);
  font-size: 15px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 767px) {
  body.mg-public .feat-phase-diagram {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
  }

  body.mg-public .feat-phase-track--seven {
    min-width: 520px;
  }
}

@media (max-width: 575px) {
  body.mg-public .feat-page-hero {
    height: auto;
    min-height: clamp(18rem, 52vh, 24rem);
    max-height: none;
    padding-block: clamp(2.5rem, 8vw, 3.5rem);
  }
}
