/* ==========================================================================
   Accounted — Feature Detail Page Styles
   Feature Detail Layout, Sticky Scroll, Sub-Feature Grid, Prev/Next Nav
   ========================================================================== */

/* ==========================================================================
   1. Feature Hero (Mini-Hero)
   ========================================================================== */

.feature-hero {
  text-align: center;
  max-width: 720px;
  margin: 0 auto;
}

.feature-hero__badge {
  margin-bottom: var(--space-4);
}

.feature-hero__title {
  margin-bottom: var(--space-4);
}

.feature-hero__text {
  font-size: 1.125rem;
  color: var(--color-text-muted);
  line-height: 1.7;
  max-width: 580px;
  margin: 0 auto;
}

/* Feature hero with device mockup */
.feature-hero__visual {
  margin-top: var(--space-12);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}


/* ==========================================================================
   2. Feature Sticky Scroll (Cinematic Sub-Features)
   ========================================================================== */

.sticky-feature {
  /* Default 300vh, JS overrides based on phase count */
  height: var(--sticky-height, 300vh);
  position: relative;
}

.sticky-feature__pinned {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.sticky-feature__inner {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-6);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-12);
  align-items: center;
}

/* Phase text — crossfade */
.sticky-feature__text {
  position: relative;
  min-height: 300px;
}

.sticky-feature__phase {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--space-4);
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity var(--duration-cinematic) var(--ease-out-expo),
    transform var(--duration-cinematic) var(--ease-out-expo);
  pointer-events: none;
}

.sticky-feature__phase.is-active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  position: relative;
}

.sticky-feature__phase-label {
  display: inline-flex;
  align-self: flex-start;
}

.sticky-feature__phase-title {
  font-family: var(--font-heading);
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.sticky-feature__phase-text {
  font-size: 1.0625rem;
  color: var(--color-text-muted);
  line-height: 1.7;
}

.sticky-feature__phase-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-2);
}

.sticky-feature__phase-list-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  font-size: 0.9375rem;
  color: var(--color-text);
  line-height: 1.4;
}

.sticky-feature__phase-list-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--color-success);
  margin-top: 2px;
}

/* Visual side */
.sticky-feature__visual {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* Device mockup in sticky section */
.sticky-feature__visual-phase {
  position: relative;
}

/* Screenshot transition */
.sticky-feature__visual-phase img {
  transition: opacity var(--duration-slow) ease;
}

/* Horizontal progress dots with track */
.sticky-feature__dots {
  position: absolute;
  left: 50%;
  bottom: var(--space-8);
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: var(--space-8);
  z-index: var(--z-content);
}

/* Horizontal track between dots */
.sticky-feature__dots-track {
  position: absolute;
  left: 7px;
  right: 7px;
  height: 3px;
  background: var(--color-border);
  border-radius: 2px;
}

/* Fill line — grows with scroll progress */
.sticky-feature__dots-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(to right, var(--color-accent), var(--color-cta, var(--color-accent)));
  border-radius: 2px;
  will-change: width;
  box-shadow: 0 0 8px var(--color-accent-glow);
}

.sticky-feature__dot {
  width: 14px;
  height: 14px;
  border-radius: var(--radius-full);
  border: 2.5px solid var(--color-border);
  background: var(--color-bg);
  cursor: pointer;
  transition: all 0.3s var(--ease-spring);
  position: relative;
  z-index: 1;
  padding: 0;
}

.sticky-feature__dot:hover {
  border-color: var(--color-accent);
  transform: scale(1.2);
}

.sticky-feature__dot.is-active {
  border-color: var(--color-accent);
  background: var(--color-accent);
  transform: scale(1.5);
  box-shadow: 0 0 16px var(--color-accent-glow);
}

.sticky-feature__dot.is-done {
  border-color: var(--color-accent);
  background: var(--color-accent);
  transform: scale(1);
}

/* Mobile layout: hide the desktop sticky scroll, show the dedicated
   feature-phases-mobile section instead. */
.feature-phases-mobile {
  display: none;
}

@media (max-width: 768px) {
  .sticky-feature {
    display: none !important;
  }

  .feature-phases-mobile {
    display: block;
    padding: var(--space-10) 0 var(--space-6);
  }

  .feature-phases-mobile .container {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
  }

  .feature-phases-mobile__item {
    background: var(--color-surface);
    border: 1px solid var(--card-border, rgba(255,255,255,0.08));
    border-radius: var(--radius-lg, 18px);
    padding: var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  }

  .feature-phases-mobile__meta {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-wrap: wrap;
  }

  .feature-phases-mobile__device {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--color-text-muted, rgba(255, 255, 255, 0.7));
    background: rgba(148, 163, 184, 0.12);
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 999px;
  }

  .feature-phases-mobile__device svg {
    flex: 0 0 auto;
    opacity: 0.85;
  }

  .feature-phases-mobile__title {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.25;
    margin: 0;
    color: var(--color-text, #fff);
  }

  .feature-phases-mobile__image {
    /* Break out to card edges so the screenshot feels full-bleed */
    margin: var(--space-2) calc(var(--space-5) * -1) var(--space-2);
    border-top: 1px solid var(--card-border, rgba(255,255,255,0.08));
    border-bottom: 1px solid var(--card-border, rgba(255,255,255,0.08));
    overflow: hidden;
    background: var(--color-bg-elevated, #0a0a0a);
  }

  .feature-phases-mobile__image img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    object-fit: contain;
  }

  .feature-phases-mobile__text {
    font-size: 0.9375rem;
    line-height: 1.6;
    margin: 0;
    color: var(--color-text-muted, rgba(255,255,255,0.7));
  }

  .feature-phases-mobile__tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-top: var(--space-1);
  }
}


/* ==========================================================================
   3. Sub-Feature Grid
   ========================================================================== */

.sub-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}

.sub-feature {
  background: var(--color-surface);
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  padding: var(--space-6);
  transition:
    transform var(--duration-normal) var(--ease-spring),
    box-shadow var(--duration-normal) ease,
    border-color var(--duration-fast) ease;
}

.sub-feature:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-accent-glow);
}

.sub-feature__icon {
  width: 40px;
  height: 40px;
  margin-bottom: var(--space-4);
  color: var(--color-accent);
}

.sub-feature__icon svg {
  width: 100%;
  height: 100%;
}

.sub-feature__title {
  font-size: 1.0625rem;
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.sub-feature__text {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}

@media (max-width: 768px) {
  .sub-features {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }
}


/* ==========================================================================
   4. Feature FAQ (Inline)
   ========================================================================== */

.feature-faq {
  max-width: 720px;
  margin: 0 auto;
}

.feature-faq__title {
  text-align: center;
  margin-bottom: var(--space-8);
}


/* ==========================================================================
   5. Feature Prev/Next Navigation
   ========================================================================== */

.feature-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  padding-top: var(--space-12);
  border-top: 1px solid var(--color-border);
  margin-top: var(--space-12);
}

.feature-nav__link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-6);
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--card-radius);
  text-decoration: none;
  color: inherit;
  transition:
    background var(--duration-fast) ease,
    border-color var(--duration-fast) ease,
    transform var(--duration-fast) var(--ease-spring);
  min-height: 44px;
}

.feature-nav__link:hover {
  background: var(--color-glass-bg);
  border-color: var(--color-accent-glow);
  transform: translateX(4px);
}

.feature-nav__link--prev:hover {
  transform: translateX(-4px);
}

.feature-nav__link--next {
  text-align: right;
  flex-direction: row-reverse;
  justify-self: end;
}

.feature-nav__link svg {
  width: 20px;
  height: 20px;
  color: var(--color-accent);
  flex-shrink: 0;
}

.feature-nav__direction {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.feature-nav__title {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--color-text);
}

.feature-nav__link:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

@media (max-width: 480px) {
  .feature-nav {
    grid-template-columns: 1fr;
  }

  .feature-nav__link--next {
    text-align: left;
    flex-direction: row;
    justify-self: start;
  }

  .feature-nav__link--prev:hover,
  .feature-nav__link--next:hover {
    transform: translateY(-2px);
  }
}


/* ==========================================================================
   6. Feature Detail Bento (smaller grid for detail page)
   ========================================================================== */

.feature-bento {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
}

.feature-bento__item {
  background: var(--color-surface);
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  padding: var(--space-6);
  transition:
    border-color var(--duration-fast) ease,
    box-shadow var(--duration-fast) ease;
}

.feature-bento__item:hover {
  border-color: var(--color-accent-glow);
  box-shadow: var(--shadow-sm);
}

.feature-bento__item--wide {
  grid-column: span 2;
}

.feature-bento__title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: var(--space-2);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.feature-bento__title svg {
  width: 18px;
  height: 18px;
  color: var(--color-accent);
}

.feature-bento__text {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}

@media (max-width: 768px) {
  .feature-bento {
    grid-template-columns: 1fr;
  }

  .feature-bento__item--wide {
    grid-column: span 1;
  }
}
