/* ============================================================= */
/* Features hub + spoke styles (wave1/home-v4-preview)            */
/* Loaded only on /features and /features/<slug>. Brand tokens    */
/* (--navy/--teal/--warm-sand/--amber/--coral) come from styles.css*/
/* ============================================================= */

/* ---- Breadcrumb (spoke) ---- */
.features-breadcrumb {
  font-size: 0.8125rem;
  color: var(--slate);
  padding: 1.5rem 0 0;
}
.features-breadcrumb a {
  color: var(--slate);
  text-decoration: none;
}
.features-breadcrumb a:hover {
  text-decoration: underline;
}
.features-breadcrumb span {
  color: var(--navy);
}

/* ---- Hero ---- */
.features-hero {
  background-color: var(--white);
  padding: 3.5rem 0 4rem;
}
.features-hero__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.features-hero__eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 1rem;
}
.features-hero__headline {
  font-size: 2.5rem;
  line-height: 1.1;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.02em;
  margin: 0 0 1.25rem;
}
@media (min-width: 880px) {
  .features-hero__headline {
    font-size: 3.25rem;
  }
}
.features-hero__intro {
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--gray-700);
  max-width: 880px;
  margin: 0 auto 2rem;
}
.features-hero__cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 2.5rem;
}
.features-hero__visual {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.features-hero__visual img {
  display: block;
  width: 100%;
  max-width: 1040px;
  height: auto;
}
@media (max-width: 1200px) {
  .features-hero__visual img { max-width: 820px; }
}
@media (max-width: 880px) {
  .features-hero__visual img { max-width: 640px; }
}
@media (max-width: 600px) {
  .features-hero__visual img { max-width: 480px; }
}
/* Spoke hero (placeholder, no img): keep generous 16:9 hero proportions. */
.features-hero__visual.media-placeholder {
  aspect-ratio: 16 / 9;
}

/* ---- Feature groups (hub) ---- */
.features-group {
  padding: 4rem 0;
}
.features-group__head {
  text-align: center;
  font-size: 2rem;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.01em;
  margin: 0 0 2.5rem;
}
.features-group__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-top: 3rem;
}

/* ---- Card grids ---- */
.features-cards {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(3, 1fr);
}
.features-cards--2x2 {
  grid-template-columns: repeat(2, 1fr);
  max-width: 960px;
  margin: 0 auto;
}
@media (max-width: 880px) {
  .features-cards,
  .features-cards--2x2 {
    grid-template-columns: 1fr;
    max-width: 520px;
  }
}
.feature-card {
  display: flex;
  flex-direction: column;
}
.feature-card__media {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg);
  overflow: hidden;
}
/* The frame lives on the CONTAINER (below); the video just fills it — no border
   or radius on the video, so there's no second rounded element to seam against. */
.feature-card__media video,
.features-hero__visual video,
.feature-altrow__media video,
.howto__media video,
.keep-learning__media video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* Frame + teal backdrop on the container: any residual sub-pixel seam reads teal,
   not the page background. Also neutralises the placeholder layout (howto carries
   padding + flex + a translucent bg; the hero is flex-centred; image heroes keep
   theirs). aspect-ratio is set per-video inline (see HTML). */
.feature-card__media:has(video),
.features-hero__visual:has(video),
.feature-altrow__media:has(video),
.howto__media:has(video),
.keep-learning__media:has(video) {
  display: block;
  padding: 0;
  border: 3px solid var(--teal);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--teal);
  line-height: 0;
}
.feature-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  padding: 1.5rem;
  flex: 1 1 auto;
}
.feature-card__title {
  font-size: 1.1875rem;
  font-weight: 700;
  color: var(--navy);
  margin: 0;
}
.feature-card__text {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--gray-700);
  margin: 0;
  flex: 1 1 auto;
}

/* ---- Alternating image/text rows (hub "Turn Your Plan", spoke body) ---- */
.feature-altrow {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  margin-bottom: 3rem;
}
.feature-altrow:last-of-type {
  margin-bottom: 0;
}
.feature-altrow__media {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.feature-altrow__title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 0.875rem;
  letter-spacing: -0.01em;
}
.feature-altrow__text {
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--gray-700);
  margin: 0 0 1.25rem;
}
.feature-altrow--reverse .feature-altrow__media {
  order: 2;
}
@media (max-width: 720px) {
  .feature-altrow {
    grid-template-columns: 1fr;
    gap: 1.25rem;
    margin-bottom: 2.5rem;
  }
  /* Mobile: text first, media second, every row */
  .feature-altrow__text-col {
    order: 0;
  }
  .feature-altrow__media {
    order: 1;
  }
  .feature-altrow--reverse .feature-altrow__media {
    order: 1;
  }
}

/* ---- "Learn more" link + disabled (unbuilt spoke) variant ---- */
.feature-link {
  font-weight: 700;
  color: var(--teal);
  text-decoration: none;
  font-size: 0.9375rem;
  align-self: flex-start;
}
.feature-link:hover {
  text-decoration: underline;
}
.feature-link.is-disabled {
  color: var(--gray-400);
  cursor: default;
  pointer-events: none;
}

/* ---- Spoke: definition/body sections ---- */
.spoke-section {
  padding: 3.5rem 0;
}
.spoke-section__title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.01em;
  margin: 0 0 1rem;
}
.spoke-section__text {
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--gray-700);
}
.spoke-subsplit {
  list-style: none;
  margin: 1.25rem 0 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}
.spoke-subsplit li {
  padding-left: 1.25rem;
  position: relative;
  line-height: 1.6;
  color: var(--gray-700);
}
.spoke-subsplit li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--teal);
}
.spoke-section__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-top: 3rem;
}

/* ---- "How To Use It" — navy single-asset auto-swipe carousel ---- */
.howto {
  background-color: var(--navy);
  padding: 4rem 0;
  color: var(--white);
}
.howto__head {
  text-align: center;
  font-size: 2rem;
  font-weight: 700;
  color: var(--white);
  margin: 0 0 2.5rem;
}
.howto__carousel {
  max-width: 860px;
  margin: 0 auto;
  text-align: center;
}
.howto__stage {
  position: relative;
}
.howto__slide {
  display: none;
  flex-direction: column;
  align-items: center;
}
.howto__slide.is-active {
  display: flex;
}
.howto__media {
  width: 100%;
  aspect-ratio: 16 / 8;
  margin-bottom: 1.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.35rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  overflow: hidden;
  color: var(--white);
}
.howto__media strong {
  color: var(--white);
}
.howto__media span {
  color: rgba(255, 255, 255, 0.75);
}
.howto__badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background-color: var(--coral);
  color: var(--white);
  font-weight: 700;
  font-size: 1.125rem;
  margin: 0 auto 1rem;
}
.howto__title {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--white);
  margin: 0 0 0.75rem;
}
.howto__desc {
  font-size: 1rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.85);
  max-width: 560px;
  margin: 0 auto 1.5rem;
}
.howto__dots {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 1.75rem;
}
.howto__dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  border: 0;
  padding: 0;
  background: rgba(255, 255, 255, 0.35);
  cursor: pointer;
}
.howto__dot.is-active {
  background: var(--teal);
}

/* ---- Keep Learning (prev / next) ---- */
.keep-learning {
  padding: 4rem 0;
}
.keep-learning__head {
  text-align: center;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 2rem;
}
.keep-learning__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  max-width: 860px;
  margin: 0 auto;
}
@media (max-width: 720px) {
  .keep-learning__grid {
    grid-template-columns: 1fr;
  }
}
.keep-learning__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-decoration: none;
}
.keep-learning__media {
  width: 100%;
  aspect-ratio: 16 / 9;
  margin-bottom: 1rem;
}
.keep-learning__dir {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal);
}
.keep-learning__name {
  display: block;
  margin-top: 0.5rem;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--navy);
}
.keep-learning__btn {
  margin-top: 1rem;
}
.keep-learning__btn.is-disabled {
  opacity: 0.5;
  pointer-events: none;
  cursor: default;
}


/* Placeholders on the features pages: clean rounded rectangles with a subtle
   light fill, NO dashed borders (per the mockups). Overrides the global
   .media-placeholder (warm-sand + dashed) — features.css loads after styles.css
   and only on the two features pages, so home's how-step boxes are unaffected.
   The navy How-To media uses .howto__media (not .media-placeholder) so it keeps
   its on-navy tint. */
.media-placeholder {
  border: none;
  background: var(--gray-100);
  border-radius: var(--radius-lg);
}

/* D5 — "How To Use It" step badge: coral -> teal countdown before each auto-swipe,
   reusing the home "How Compass Works" pattern (how-badge-fill keyframe lives in
   styles.css; badge base is coral, teal fill grows L->R over the 5s dwell).
   Disabled under reduced-motion; the carousel JS also stops auto-advance then. */
@media (prefers-reduced-motion: no-preference) {
  .howto__slide.is-active .howto__badge {
    background-image: linear-gradient(var(--teal), var(--teal));
    background-repeat: no-repeat;
    background-position: left center;
    background-size: 0% 100%;
    animation: how-badge-fill 5s linear forwards;
  }
}
