/* ===== Core Features — tilted-card carousel (Figma 7563-484) ===== */

.features {
  padding: 100px 0 100px;
  overflow: hidden; /* clip peeking side cards to the viewport (no page h-scroll) */
}
.features__title {
  text-align: center;
  font-family: var(--font-family-base);
  font-size: clamp(44px, 6.5vw, 96px);
  font-weight: var(--font-weight-black);
  color: var(--color-label-primary);
  margin: 0 0 72px;
}

/* ===== Carousel shell + arrows ===== */
.carousel { position: relative; }

.features-stage {
  position: relative;
  height: clamp(640px, 66vw, 760px);
}

.feature-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 40;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-accent-yellow);
  border: 3px solid var(--color-black);
  box-shadow: 0.15em 0.15em var(--color-black);
  color: var(--color-black);
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.feature-arrow i { font-size: 32px; font-weight: 900;}
.feature-arrow--prev { left: clamp(8px, 3vw, 44px); }
.feature-arrow--next { right: clamp(8px, 3vw, 44px); }
.feature-arrow:hover {
  transform: translateY(-50%) translate(-0.05em, -0.05em);
  box-shadow: 0.22em 0.22em var(--color-black);
}
.feature-arrow:active {
  transform: translateY(-50%) translate(0.05em, 0.05em);
  box-shadow: 0.08em 0.08em var(--color-black);
}

/* ===== Cards ===== */
.feature-card {
  --fc-w: min(95vw, 1100px);
  /* ↓↓↓ CAROUSEL SPACING KNOB — gap between the front card and each side card. Lower = tighter. ↓↓↓ */
  --card-gap: 140px;
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--fc-w);
  height: 100%;
  display: flex;
  align-items: center;
  gap: 72px;
  padding: 48px 48px;
  border-radius: 48px;
  background: var(--accent-50);
  transform: translate(-50%, -50%) scale(0.78);
  opacity: 0;
  z-index: 1;
  pointer-events: none;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.45s ease;
  will-change: transform, opacity;
}
.feature-card.is-active {
  transform: translate(-50%, -50%) scale(1) rotate(0deg);
  opacity: 1;
  z-index: 30;
  pointer-events: auto;
}
/* Side cards: smaller, vertically centered on the front card, and tilted.
   Their content is hidden (below) so only the coloured panel peeks.
   Positioning constant = 0.5 (front half) + side-scale/2, so the --card-gap
   between the front card's edge and the side panel stays width-independent. */
.feature-card.is-left {
  transform: translate(-50%, -50%) translateX(calc(-1 * (var(--fc-w) * 0.84 + var(--card-gap)))) scale(0.68) rotate(-6deg);
  opacity: 1;
  z-index: 20;
  cursor: pointer;
}
.feature-card.is-right {
  transform: translate(-50%, -50%) translateX(calc(var(--fc-w) * 0.84 + var(--card-gap))) scale(0.68) rotate(6deg);
  opacity: 1;
  z-index: 20;
  cursor: pointer;
}
.feature-card.is-hidden {
  transform: translate(-50%, -50%) scale(0.7);
  opacity: 0;
  z-index: 1;
}

/* Only the front (active) card shows its content — side cards are bare colour panels */
.feature-card__body,
.feature-phone { transition: opacity 0.35s ease; }
.feature-card.is-left .feature-card__body,
.feature-card.is-left .feature-phone,
.feature-card.is-right .feature-card__body,
.feature-card.is-right .feature-phone { opacity: 0; }

/* accent palettes (bg = 50, badge/icons/labels = 100 / 800) */
.feature-card--blue  { --accent-50: var(--color-blue-50);  --accent-100: var(--color-blue-100);  --accent-800: var(--color-blue-800); }
.feature-card--pink  { --accent-50: var(--color-pink-50);  --accent-100: var(--color-pink-100);  --accent-800: var(--color-pink-800); }
.feature-card--yellow { --accent-50: var(--color-yellow-50); --accent-100: var(--color-yellow-100);--accent-800: var(--color-yellow-800); }
.feature-card--green { --accent-50: var(--color-green-50); --accent-100: var(--color-green-100); --accent-800: var(--color-green-800); }

/* ===== Card body (left) ===== */
.feature-card__body {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 560px;
  align-self: stretch;       /* fill the card's full height… */
  display: flex;
  flex-direction: column;
  justify-content: flex-start; /* …content aligned to the top */
  /* ↓↓↓ INDIVIDUAL SPACING between the stacked elements — tweak each on its own ↓↓↓ */
  --gap-badge-title: 20px; /* badge  → title    */
  --gap-title-sub: 16px;   /* title  → subtitle */
  --gap-sub-list: 40px;    /* subtitle → feature list */
  /* (the watch-demo button is pinned to the card bottom via margin-top: auto) */
}
.feature-badge {
  align-self: flex-start;
  background: var(--accent-100);
  color: var(--accent-800);
  font-weight: var(--font-weight-black);
  text-transform: uppercase;
  font-size: var(--font-size-heading-xs);
  letter-spacing: 0.02em;
  padding: 10px 16px;
  border-radius: 999px;
}
.feature-card__intro { display: flex; flex-direction: column; margin-top: var(--gap-badge-title); gap: var(--gap-title-sub); }
.feature-card__title {
  font-size: clamp(28px, 2.5vw, 64px);
  font-weight: var(--font-weight-extrabold);
  color: var(--color-label-primary);
  line-height: var(--line-height-m);
}
.feature-card__sub {
  font-size: clamp(15px, 1.35vw, 22px);
  font-weight: var(--font-weight-bold);
  color: var(--color-label-secondary);
  line-height: 1.4;
}

.feature-list { list-style: none; display: flex; flex-direction: column; gap: 10px; margin-top: var(--gap-sub-list); }
.feature-list li { display: flex; align-items: center; gap: 8px; }
.feature-list i { font-size: 22px; color: var(--accent-800); flex-shrink: 0; }
.feature-list span {
  font-size: clamp(14px, 1.25vw, 18px);
  font-weight: var(--font-weight-black);
  text-transform: uppercase;
  color: var(--accent-800);
}

/* ===== "Watch the demo" CTA ===== */
.feature-demo {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: auto; /* pinned to the bottom of the card */
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}
.feature-demo__btn {
  width: 100px;
  height: 60px;
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s ease;
}
.feature-demo:hover .feature-demo__btn { background: rgba(0, 0, 0, 0.09); }
.feature-demo__btn i { font-size: 24px; color: #1b140f; }
.feature-demo__text { display: flex; flex-direction: column; gap: 4px; }
.feature-demo__text strong {
  display: block;
  font-size: clamp(16px, 1.35vw, 20px);
  font-weight: var(--font-weight-extrabold);
  color: #000;
  line-height: 1.2;
}
.feature-demo__text span {
  font-size: 16px;
  font-weight: var(--font-weight-bold);
  color: rgba(60, 60, 67, 0.6);
}

/* ===== iPhone mockup (right) — reuses the bezel screen-window insets ===== */
.feature-phone {
  position: relative;
  height: 100%;
  aspect-ratio: 900 / 1840;
  flex-shrink: 0;
  align-self: center;
}
.feature-phone__bezel {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
  user-select: none;
}
.feature-phone__screen {
  position: absolute;
  left: 5.44%;
  right: 5.44%;
  top: 2.55%;
  bottom: 2.55%;
  border-radius: clamp(18px, 8cqw, 34px);
  overflow: hidden;
  background: var(--color-bg-secondary);
  container-type: inline-size;
  z-index: 1;
}
.feature-phone__screen img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ===== Responsive ===== */
@media (max-width: 860px) {
  .features { padding: 32px 16px 32px; } /* 16px gap from the screen edges */
  .features__title { margin-bottom: 20px; }
  /* stage + active card hug their content (no fixed tall height on mobile) */
  .features-stage { height: auto; }
  .feature-card {
    width: 100%;          /* fill the (16px-inset) stage evenly on both sides */
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    gap: 0; /* spacing is set per-element via margin-top below */
    padding: 24px 24px;
    border-radius: 40px;
  }
  .feature-card.is-active {
    position: relative;   /* flow in place so the stage grows to fit it */
    inset: auto;
    transform: none;
    height: auto;
  }
  .feature-card.is-left, .feature-card.is-right, .feature-card.is-hidden { opacity: 0; pointer-events: none; }
  /* promote the body's children into the card's column so the phone can sit between them */
  .feature-card__body { display: contents; }

  /* order: badge → title/subtitle → PHONE → feature list → demo */
  /* ↓↓↓ smaller badge on mobile — tweak font-size / padding ↓↓↓ */
  .feature-badge { order: 1; align-self: flex-start; font-size: 14px; padding: 8px 16px; }
  .feature-card__intro { order: 2; margin-top: 16px; }

  /* ↓↓↓ PHONE MOCKUP (sits right under the subtitle) — tweak: ↓↓↓
     height   = size of the phone
     margin   = gap above (under subtitle) / below (before feature list) */
  .feature-phone {
    order: 3;
    display: block;
    height: clamp(400px, 42vw, 240px); /* ← phone size (mobile) — tweak me */
    width: auto;
    align-self: center;
    margin: 24px 0 0px;
  }

  .feature-list { order: 4; align-items: flex-start; margin-top: 32px; }

  /* ↓↓↓ smaller "watch the demo" on mobile ↓↓↓ */
  .feature-demo { order: 5; margin-top: 32px; gap: 10px; }
  .feature-demo__btn { width: 72px; height: 46px; border-radius: 16px; }
  .feature-demo__btn i { font-size: 20px; }
  .feature-demo__text strong { font-size: 16px; }
  .feature-demo__text span { font-size: 14px; }
  /* Arrows sit in the same horizontal stack as the phone: features.js pins each
     one --arrow-gap away from the phone's edge, vertically centred on it. So
     they always hug the phone (follow its size) — never drop to the bottom. */
  .carousel {
    padding-bottom: 0;
    /* ↓↓↓ ARROW POSITION (mobile) — tweak me ↓↓↓ */
    --arrow-gap: 24px; /* spacing between each arrow and the phone */
    --arrow-y: 0px;    /* vertical nudge from the phone's centre (positive = down, negative = up) */
  }
  .feature-arrow {
    width: 48px; height: 48px;
    top: 50%; bottom: auto; left: auto; right: auto; /* top/left set by features.js */
    transform: translateY(-50%);
  }
  .feature-arrow:hover { transform: translateY(-50%) scale(1.06); }
  .feature-arrow:active { transform: translateY(-50%) scale(0.94); }
  .feature-arrow i { font-size: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .feature-card { transition: opacity 0.3s ease; }
}
