/**
 * 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;
  min-height: 480px;
  height: 480px;
  max-height: min(480px, 70vh);
  background: var(--navy-900);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

body.mg-public .feat-page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.05) 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(14, 158, 118, 0.14) 0%, transparent 55%),
    radial-gradient(ellipse 45% 45% at 10% 15%, rgba(29, 78, 216, 0.12) 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;
}

body.mg-public .feat-page-hero .section-label-white {
  color: rgba(255, 255, 255, 0.65);
}

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

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

body.mg-public .feat-page-hero .feat-hero-lead {
  color: rgba(255, 255, 255, 0.68);
  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: 90px;
}

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(14, 158, 118, 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 mock cards */
body.mg-public .feat-grant-mock {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

body.mg-public .feat-grant-card {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow-card);
}

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

body.mg-public .feat-grant-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

body.mg-public .feat-grant-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--bg-light);
  border: 1px solid var(--border-light);
}

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

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

body.mg-public .feat-grant-match {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 600;
  color: var(--teal-500);
  line-height: 1;
}

body.mg-public .feat-grant-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

body.mg-public .feat-grant-status {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 100px;
  background: rgba(14, 158, 118, 0.12);
  color: var(--teal-600);
  margin-bottom: 8px;
}

body.mg-public .feat-grant-btn {
  display: block;
  width: 100%;
  text-align: center;
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--teal-500);
  color: var(--teal-600);
  font-size: 13px;
  font-weight: 600;
  background: transparent;
  cursor: default;
}

/* 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(14, 158, 118, 0.18);
  border: 1px solid rgba(14, 158, 118, 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(14, 158, 118, 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(14, 158, 118, 0.25);
}

/* 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(14, 158, 118, 0.25), rgba(10, 22, 40, 0.08));
  border: 2px solid rgba(14, 158, 118, 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, #0a7a5c 0%, #0e9e76 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 .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: 575px) {
  body.mg-public .feat-page-hero {
    height: auto;
    min-height: 380px;
    max-height: none;
  }
}
