.features-page {
  position: relative; z-index: 2;
}

/* ── Last section overlay extends to cover the disclaimer area ── */
.feature-section:last-of-type {
  overflow: visible;
}
.feature-section:last-of-type .feature-overlay {
  bottom: -200px;
}

/* ── Disclaimer ── */
.features-disclaimer {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 32px 24px 48px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #7cd7b9;
  letter-spacing: 2px;
  line-height: 1.8;
  border-top: 1px solid var(--border);
  max-width: 640px;
  margin: 0 auto;
}

/* ── Eye toggle button (desktop + mobile) ── */
.feat-eye-btn {
  display: flex;
  position: fixed;
  bottom: 32px;
  right: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(4,10,6,0.88);
  border: 1px solid rgba(0,200,180,0.35);
  color: var(--teal);
  cursor: pointer;
  z-index: 50;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 18px rgba(0,200,180,0.12);
  transition: opacity 0.25s ease, transform 0.25s ease,
              border-color 0.2s, box-shadow 0.2s, background 0.2s;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.feat-eye-btn:hover,
.feat-eye-btn:active {
  border-color: var(--teal);
  box-shadow: 0 0 24px rgba(0,200,180,0.28);
  background: rgba(0,200,180,0.1);
}
/* Glow when panels are hidden (active state) */
body.feat-panels-hidden .feat-eye-btn {
  border-color: var(--teal);
  box-shadow: 0 0 20px rgba(0,200,180,0.3);
  color: var(--text-bright);
}
/* Hidden when scrolled past the last section (set by JS) */
.feat-eye-btn.feat-eye-btn--gone {
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
}

/* ── Eye-toggle hidden state (desktop + mobile) ── */
.feature-content { transition: opacity 0.25s ease, transform 0.25s ease; }
.feature-overlay { transition: opacity 0.5s ease; }
.feat-bg-fixed::after { transition: opacity 0.5s ease; }

body.feat-panels-hidden .feature-content {
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
}
body.feat-panels-hidden .feature-overlay {
  opacity: 0;
}
body.feat-panels-hidden .feat-bg-fixed::after {
  opacity: 0;
}

/* ── Crossfade background layers (JS-driven) ── */
.feat-bg-fixed {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

/* Always darken the top so the nav remains readable over any image */
.feat-bg-fixed::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 140px;
  background: linear-gradient(to bottom, rgba(4,10,6,0.75) 0%, transparent 100%);
  z-index: 2;
  pointer-events: none;
}

.feat-bg-layer {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 0.9s ease;
  will-change: opacity;
  /* Lift the image so it reads brighter under the overlay. Overlay opacity
     stays unchanged - only the underlying image is brightened. */
  filter: brightness(1.18) saturate(1.05);
}

.feat-bg-layer.active { opacity: 1; }

.feature-section {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  z-index: 2;
}

.feature-bg {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: rgba(4,10,6,1);
}

.feature-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(
    to right,
    rgba(4,10,6,0.88) 0%,
    rgba(4,10,6,0.55) 45%,
    rgba(4,10,6,0.05) 100%
  );
}

.feature-content {
  position: relative; z-index: 2;
  margin-left: clamp(24px, 8vw, 120px);
  max-width: 520px;
  padding: 48px 40px;
}

.feature-num {
  font-family: var(--font-mono);
  font-size: 48px;
  color: rgba(0,200,180,0.35);
  letter-spacing: 4px;
  line-height: 1;
  margin-bottom: 4px;
  user-select: none;
}

.feature-title {
  font-family: var(--font-hud);
  font-size: clamp(22px, 3.5vw, 36px);
  font-weight: 700;
  color: var(--text-bright);
  letter-spacing: 2px;
  margin-bottom: 20px;
  margin-top: 8px;
}

.feature-desc {
  font-size: 16px;
  color: var(--text);
  line-height: 1.7;
  margin-bottom: 28px;
}

.feature-bullets {
  list-style: none;
  display: flex; flex-direction: column; gap: 10px;
}

.feature-bullets li {
  display: flex; align-items: flex-start; gap: 12px;
  font-size: 15px;
  color: var(--text);
  line-height: 1.5;
}

.feature-bullets li::before {
  content: '›';
  color: var(--teal);
  font-size: 18px;
  line-height: 1.3;
  flex-shrink: 0;
}

/* Odd sections - content on left (default) */
/* Even sections - content on right */
.feature-section:nth-child(even) .feature-overlay {
  background: linear-gradient(
    to left,
    rgba(4,10,6,0.88) 0%,
    rgba(4,10,6,0.55) 45%,
    rgba(4,10,6,0.05) 100%
  );
}
.feature-section:nth-child(even) .feature-content {
  margin-left: auto;
  margin-right: clamp(24px, 8vw, 120px);
}

@media (max-width: 768px) {
  /* Tall enough that the image shows above the content */
  .feature-section {
    min-height: 88vh;
    padding: 0;
    align-items: flex-end;
  }

  /* Vertical gradient: image visible at top, readable text at bottom */
  .feature-overlay,
  .feature-section:nth-child(even) .feature-overlay {
    background: linear-gradient(
      to bottom,
      rgba(4,10,6,0.0)  0%,
      rgba(4,10,6,0.30) 28%,
      rgba(4,10,6,0.88) 55%,
      rgba(4,10,6,0.97) 100%
    ) !important;
  }

  /* Content panel: full width, anchored at bottom, no glassmorphism */
  .feature-content {
    margin: 0 !important;
    width: 100%;
    max-width: 100%;
    padding: 28px 20px 36px;
    border-radius: 0;
    border-right: none;
    border-bottom: none;
    border-top: 1px solid rgba(0,200,180,0.12);
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
  }

  .feature-bullets li { font-size: 14px; }

  /* Reduce the top-of-viewport darkening so image shows clearly */
  .feat-bg-fixed::after { height: 80px; }

  /* Slowly pan landscape images so users see the full width on portrait screens.
     Both layers share the same animation so crossfades stay in sync. */
  .feat-bg-layer {
    animation: bg-pan 22s ease-in-out infinite alternate;
  }
}

@keyframes bg-pan {
  from { background-position: 15% center; }
  to   { background-position: 85% center; }
}

@media (max-width: 768px) and (prefers-reduced-motion: reduce) {
  .feat-bg-layer { animation: none; background-position: center; }
}

@media (max-width: 480px) {
  .feature-section { min-height: 90vh; }
  .feature-content { padding: 24px 16px 32px; }
  .feature-num { font-size: 36px; }
  .feature-desc { font-size: 15px; }
}
