/* ==========================================================================
   Public Features Page — MVI Analytics
   Aurora Glass v2.0 landing / presentation
   ========================================================================== */

/* ─── Top bar ─── */
.features-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-6);
  background: var(--bg-glass-strong);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-glass);
}

.features-topbar .nav-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-weight: 700;
  font-size: var(--text-lg);
  color: var(--text-primary);
}

.features-topbar .nav-brand i {
  color: var(--accent-primary);
}

.features-topbar .nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  list-style: none;
}

.features-topbar .nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: var(--text-sm);
  transition: color var(--transition-fast);
}

.features-topbar .nav-links a:hover,
.features-topbar .nav-links a.active {
  color: var(--text-primary);
}

.features-topbar .nav-cta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

/* ─── Page wrapper ─── */
.features-page {
  --subnav-height: 56px;
  padding-top: calc(var(--header-height) + var(--subnav-height));
  overflow-x: hidden;
}

/* ─── Hero ─── */
.features-hero {
  position: relative;
  min-height: calc(100vh - var(--header-height));
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-12) var(--space-6);
}

.features-hero-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.features-hero-bg .glow-orb-primary {
  top: 10%;
  left: 15%;
  width: 400px;
  height: 400px;
  opacity: 0.35;
}

.features-hero-bg .glow-orb-secondary {
  bottom: 10%;
  right: 10%;
  width: 350px;
  height: 350px;
  opacity: 0.3;
}

.features-hero-content {
  position: relative;
  z-index: 1;
  max-width: 900px;
}

.features-hero h1 {
  font-size: clamp(var(--text-4xl), 6vw, var(--text-5xl));
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-6);
}

.features-hero .subtitle {
  font-size: var(--text-xl);
  color: var(--text-secondary);
  max-width: 700px;
  margin: 0 auto var(--space-8);
  line-height: 1.6;
}

.features-hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.features-hero-logo {
  width: 200px;
  height: 200px;
  margin: 0 auto var(--space-8);
  color: var(--accent-primary);
}

.features-hero-logo svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.logo-breathe .logo-orbit-group {
  transform-origin: 200px 200px;
  animation: logoOrbitDrift 20s ease-in-out infinite;
}

@keyframes logoOrbitDrift {
  0%, 100% { transform: rotate(0deg); }
  33% { transform: rotate(120deg); }
  66% { transform: rotate(240deg); }
}

.logo-breathe .logo-orbit-seg {
  animation: logoOrbitPulse 4s ease-in-out infinite;
}

.logo-breathe .logo-orbit-seg:nth-child(1) { animation-delay: 0s; }
.logo-breathe .logo-orbit-seg:nth-child(2) { animation-delay: 1s; }
.logo-breathe .logo-orbit-seg:nth-child(3) { animation-delay: 2s; }
.logo-breathe .logo-orbit-seg:nth-child(4) { animation-delay: 3s; }

@keyframes logoOrbitPulse {
  0%, 100% { opacity: 0.4; stroke-width: 2.5px; }
  50% { opacity: 1; stroke-width: 4px; filter: drop-shadow(0 0 6px currentColor); }
}

.logo-breathe .logo-cube {
  animation: logoCubeBreathe 3s ease-in-out infinite;
}

@keyframes logoCubeBreathe {
  0%, 100% { opacity: 0.75; filter: drop-shadow(0 0 4px var(--accent-primary)); }
  50% { opacity: 1; filter: drop-shadow(0 0 14px var(--accent-secondary)); }
}


/* ─── Sections ─── */
.features-section {
  padding: var(--space-16) 0;
}

.features-section.alt {
  background: linear-gradient(180deg, transparent, var(--bg-glass) 40%, transparent);
}

.section-header {
  text-align: center;
  max-width: 760px;
  margin: 0 auto var(--space-12);
}

.section-header h2 {
  font-size: clamp(var(--text-2xl), 4vw, var(--text-3xl));
  font-weight: 800;
  margin-bottom: var(--space-4);
  letter-spacing: -0.02em;
}

.section-header p {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  line-height: 1.6;
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-primary);
  margin-bottom: var(--space-3);
}

/* ─── Value cards ─── */
.value-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-6);
  margin-bottom: var(--space-12);
}

.value-card {
  padding: var(--space-6);
  border-radius: var(--radius-xl);
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  text-align: center;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.value-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.value-icon {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--accent-primary) 12%, transparent);
  color: var(--accent-primary);
  font-size: 1.75rem;
  margin: 0 auto var(--space-4);
}

.value-card h3 {
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: var(--space-2);
}

.value-card p {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  line-height: 1.6;
}

/* ─── Stats ─── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-6);
  margin-top: var(--space-10);
}

.stat-card {
  padding: var(--space-6);
  border-radius: var(--radius-xl);
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  text-align: center;
}

.stat-value {
  font-size: var(--text-3xl);
  font-weight: 800;
  color: var(--accent-primary);
  margin-bottom: var(--space-2);
}

.stat-label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

/* ─── Feature rows ─── */
.feature-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: var(--space-10);
  margin-bottom: var(--space-16);
}

.feature-row:last-child {
  margin-bottom: 0;
}

.feature-row.reverse {
  direction: rtl;
}

.feature-row.reverse > * {
  direction: ltr;
}

.feature-media {
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--border-glass);
  box-shadow: var(--shadow-lg);
  background: var(--bg-glass);
}

.feature-media img {
  width: 100%;
  height: auto;
  display: block;
}

.feature-media .scr-light {
  display: none;
}

[data-theme="light"] .feature-media .scr-dark {
  display: none;
}

[data-theme="light"] .feature-media .scr-light {
  display: block;
}

.feature-media-placeholder {
  aspect-ratio: 16 / 10;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 4rem;
}

.feature-content h3 {
  font-size: var(--text-2xl);
  font-weight: 700;
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.feature-content h3 i {
  color: var(--accent-primary);
}

.feature-content > p {
  color: var(--text-secondary);
  font-size: var(--text-base);
  line-height: 1.7;
  margin-bottom: var(--space-5);
}

.feature-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.feature-list li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  line-height: 1.6;
}

.feature-list li i {
  margin-top: 2px;
  color: var(--accent-success);
  flex-shrink: 0;
}

/* ─── Metrics ─── */
.metrics-section {
  background: var(--bg-glass);
  border-top: 1px solid var(--border-glass);
  border-bottom: 1px solid var(--border-glass);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-4);
}

.metric-card {
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  transition: transform var(--transition-fast);
}

.metric-card:hover {
  transform: translateY(-4px);
}

.metric-card h4 {
  font-size: var(--text-base);
  font-weight: 700;
  margin-bottom: var(--space-1);
  color: var(--text-primary);
}

.metric-card .metric-abbr {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: var(--space-3);
}

.metric-card p {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ─── Steps ─── */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-6);
  counter-reset: step;
}

.step-card {
  position: relative;
  padding: var(--space-6);
  border-radius: var(--radius-xl);
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
}

.step-card::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  top: calc(var(--space-4) * -1);
  left: var(--space-6);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-primary-dim), var(--accent-primary));
  color: var(--text-inverse);
  font-weight: 800;
  font-size: var(--text-lg);
  box-shadow: 0 4px 14px var(--glow-primary);
}

.step-card h3 {
  font-size: var(--text-lg);
  font-weight: 700;
  margin: var(--space-4) 0 var(--space-2);
}

.step-card p {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  line-height: 1.6;
}

/* ─── CTA ─── */
.features-cta {
  position: relative;
  text-align: center;
  padding: var(--space-16) var(--space-6);
  border-radius: var(--radius-2xl);
  margin: var(--space-12) 0;
  background: linear-gradient(135deg, var(--bg-glass-strong), var(--bg-glass));
  border: 1px solid var(--border-glass);
  overflow: hidden;
}

.features-cta::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, var(--glow-primary) 0%, transparent 60%);
  opacity: 0.3;
  pointer-events: none;
}

.features-cta h2 {
  position: relative;
  font-size: var(--text-3xl);
  font-weight: 800;
  margin-bottom: var(--space-4);
}

.features-cta p {
  position: relative;
  color: var(--text-secondary);
  font-size: var(--text-lg);
  max-width: 560px;
  margin: 0 auto var(--space-8);
}

/* ─── Footer ─── */
.features-footer {
  padding: var(--space-10) 0;
  border-top: 1px solid var(--border-glass);
  text-align: center;
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.features-footer p {
  margin-bottom: var(--space-2);
}

/* ─── Responsive ─── */
@media (max-width: 1024px) {
  .value-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .feature-row,
  .feature-row.reverse {
    grid-template-columns: 1fr;
    direction: ltr;
  }

  .feature-row.reverse > * {
    direction: ltr;
  }

  .feature-media {
    order: -1;
  }

  .steps-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .features-topbar .nav-links {
    display: none;
  }

  .features-hero {
    min-height: auto;
    padding: var(--space-10) var(--space-4);
  }

  .features-hero-logo {
    width: 140px;
    height: 140px;
  }

  .features-hero-actions {
    flex-direction: column;
    width: 100%;
  }

  .features-hero-actions .btn {
    width: 100%;
  }

  .value-grid,
  .stats-grid,
  .steps-grid {
    grid-template-columns: 1fr;
  }

  .features-section {
    padding: var(--space-10) 0;
  }
}

/* ─── Theme-aware screenshots ─── */
.feature-media .scr-light {
  display: none;
}

[data-theme="light"] .feature-media .scr-dark {
  display: none;
}

[data-theme="light"] .feature-media .scr-light {
  display: block;
}

/* ─── Contact modal ─── */
.features-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-base), visibility var(--transition-base);
}

.features-modal.active {
  opacity: 1;
  visibility: visible;
}

.features-modal-content {
  position: relative;
  width: 100%;
  max-width: 460px;
  padding: var(--space-8);
  border-radius: var(--radius-2xl);
  background: var(--bg-glass-strong);
  border: 1px solid var(--border-glass);
  box-shadow: var(--shadow-xl);
  transform: translateY(16px);
  transition: transform var(--transition-base);
}

.features-modal.active .features-modal-content {
  transform: translateY(0);
}

.features-modal-close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: none;
  background: var(--bg-glass);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.features-modal-close:hover {
  background: var(--bg-glass-hover);
  color: var(--text-primary);
}

.features-modal-header {
  text-align: center;
  margin-bottom: var(--space-6);
}

.features-modal-header h3 {
  font-size: var(--text-xl);
  font-weight: 700;
  margin-bottom: var(--space-2);
}

.features-modal-header p {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  line-height: 1.6;
}

.features-modal-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.contact-link {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-lg);
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.contact-link:hover {
  background: var(--bg-glass-hover);
  transform: translateX(4px);
}

.contact-link i {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent-primary) 12%, transparent);
  color: var(--accent-primary);
  font-size: 1.25rem;
}

/* ─── Custom reports ─── */
.custom-reports-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-6);
  margin-bottom: var(--space-12);
}

.custom-report-card {
  padding: var(--space-6);
  border-radius: var(--radius-xl);
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.custom-report-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.custom-report-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--accent-primary) 12%, transparent);
  color: var(--accent-primary);
  font-size: 1.5rem;
  margin-bottom: var(--space-4);
}

.custom-report-card h3 {
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: var(--space-2);
}

.custom-report-card p {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  line-height: 1.6;
}

.custom-reports-cta {
  text-align: center;
}

.custom-reports-cta p {
  color: var(--text-secondary);
  font-size: var(--text-lg);
  max-width: 560px;
  margin: 0 auto;
}

/* ─── Top bar logo ─── */
.features-topbar .nav-brand .mvi-logo {
  flex-shrink: 0;
}

/* ─── Inline links inside steps ─── */
.inline-link {
  color: var(--accent-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--transition-fast);
}

.inline-link:hover {
  color: var(--accent-secondary);
}

/* ─── Sticky sub-navigation (under topbar) ─── */
.features-subnav {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  z-index: 999;
  height: var(--subnav-height);
  background: var(--bg-glass-strong);
  border-bottom: 1px solid var(--border-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.features-subnav-track {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: 100%;
  padding: 0 var(--space-6);
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.features-subnav-track::-webkit-scrollbar {
  display: none;
}

.features-subnav-link {
  position: relative;
  flex-shrink: 0;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full, 9999px);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
}

.features-subnav-link:hover {
  color: var(--text-primary);
  background: var(--bg-glass-hover);
}

.features-subnav-link.active {
  color: var(--text-inverse);
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  box-shadow: 0 4px 16px var(--glow-primary);
}

/* Mobile: align track to the left so pills are reachable */
@media (max-width: 768px) {
  .features-subnav-track {
    justify-content: flex-start;
    padding: var(--space-3) var(--space-4);
  }
}
