.feature-section {
  color: var(--figma-copy);
  background: #fff;
}

.feature-section.screen-panel--dark {
  color: #fff;
  background: var(--ink-dark);
}

/* Desktop is a proportional 3840 x 1862 Figma canvas. Every measurement below
   is derived from that frame, so the composition scales without drifting. */
.editorial-layout {
  position: relative;
  width: min(100%, calc(100svh * 3840 / 1862));
  height: auto;
  aspect-ratio: 3840 / 1862;
  margin-inline: auto;
  overflow: hidden;
  container-type: inline-size;
}

.editorial-layout::before {
  position: absolute;
  z-index: 0;
  left: 19.21875%;
  top: 9.72073%;
  width: 12.239583%;
  aspect-ratio: 1;
  background: url('../assets/figma/feature-halo.svg') center / 100% 100% no-repeat;
  content: '';
  pointer-events: none;
}

.editorial-layout::after {
  position: absolute;
  z-index: 0;
  left: 19.973958%;
  top: 40.923738%;
  width: 24.037109%;
  height: 36.248121%;
  background: url('../assets/figma/feature-loop.svg') center / 100% 100% no-repeat;
  content: '';
  opacity: .65;
  pointer-events: none;
}

.screen-panel--dark .editorial-layout::before {
  filter: none;
  opacity: .85;
}

.screen-panel--dark .editorial-layout::after {
  filter: invert(1);
  opacity: .24;
}

.editorial-media {
  position: absolute;
  z-index: 2;
  left: 24.21875%;
  top: 16.648765%;
  width: 14.921875%;
  height: 66.648765%;
  box-sizing: border-box;
  min-width: 0;
}

.editorial-copy {
  position: absolute;
  z-index: 1;
  left: 50%;
  top: 26.960258%;
  width: 29.765625%;
  height: 47.207304%;
  min-width: 0;
}

.screen-kicker {
  position: absolute;
  top: 0;
  left: 0;
  min-width: 4.140625cqw;
  height: 1.40625cqw;
  margin: 0;
  padding: 0 .520833cqw;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  border-radius: 0 .78125cqw .78125cqw 0;
  background: var(--brand);
  font-family: var(--font-display);
  font-size: .78125cqw;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
}

.editorial-copy h2 {
  position: absolute;
  top: 2.34375cqw;
  left: 0;
  max-width: 100%;
  margin: 0;
  color: #000;
  font-family: var(--font-display);
  font-size: 2.8125cqw;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0;
  white-space: nowrap;
}

.active-feature-description {
  position: absolute;
  top: 7.291667cqw;
  left: 0;
  width: 100%;
  max-width: none;
  margin: 0;
  color: var(--figma-copy);
  font-family: var(--font-display);
  font-size: 1.5625cqw;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0;
}

.feature-tabs-slot {
  position: absolute;
  top: 13.255208cqw;
  left: 0;
  width: 100%;
}

.feature-tabs {
  width: 100%;
  margin: 0;
  display: flex;
  gap: .65726cqw;
  overflow: visible;
  scrollbar-width: none;
}

.feature-tabs::-webkit-scrollbar {
  display: none;
}

.feature-section--settings .feature-tabs {
  flex-wrap: wrap;
  overflow-x: visible;
}

.feature-tabs button {
  min-width: 0;
  min-height: 2.317708cqw;
  padding: 0 1.188774cqw;
  flex: 0 0 auto;
  color: var(--figma-muted);
  border: .026042cqw solid var(--figma-border);
  border-radius: 1.171875cqw;
  background: transparent;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: .830729cqw;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  transition: color 220ms var(--ease-editorial), border-color 220ms var(--ease-editorial), background 220ms var(--ease-editorial);
}

.feature-tabs button[aria-selected='true'] {
  color: var(--brand);
  border-color: var(--brand);
  background: var(--brand-pale);
  font-weight: 700;
}

.feature-separator {
  position: absolute;
  top: 16.848958cqw;
  left: 0;
  width: 28.072917cqw;
  height: .026042cqw;
  margin: 0;
  background: rgba(42, 46, 46, .22);
}

.feature-group-detail {
  position: absolute;
  top: 18.125cqw;
  left: 0;
  width: 100%;
  margin: 0;
}

.feature-section--settings .feature-separator {
  top: 20.729167cqw;
}

.feature-section--settings .feature-group-detail {
  top: 22.005208cqw;
}

.feature-group-detail h3 {
  margin: 0;
  color: #24212a;
  font-family: var(--font-display);
  font-size: 1.041667cqw;
  font-weight: 500;
  line-height: 1.5;
}

.feature-group-detail p {
  max-width: 24.739583cqw;
  margin: .130208cqw 0 0;
  color: var(--figma-muted);
  font-family: var(--font-display);
  font-size: .729167cqw;
  font-weight: 400;
  line-height: 1.5;
}

.screen-panel--dark .editorial-copy h2,
.screen-panel--dark .feature-group-detail h3 {
  color: #fff;
}

.screen-panel--dark .active-feature-description {
  color: #b9b3bf;
}

.screen-panel--dark .feature-group-detail p {
  color: rgba(255, 255, 255, .5);
}

.screen-panel--dark .feature-tabs button {
  color: #77727d;
  border-color: rgba(238, 234, 253, .28);
}

.screen-panel--dark .feature-tabs button[aria-selected='true'] {
  color: var(--brand);
  border-color: #eeeafd;
  background: #eeeafd;
}

.screen-panel--dark .feature-separator {
  background: rgba(238, 234, 253, .28);
}

.phone-visual {
  position: relative;
  isolation: isolate;
  width: 100%;
  height: 100%;
  max-width: 100%;
  overflow: hidden;
  border: .026042cqw solid rgba(15, 11, 33, .8);
  border-radius: 1.5625cqw;
  background: #fff;
  box-shadow: 0 .78125cqw .78125cqw .78125cqw rgba(134, 98, 253, .05);
}

.phone-visual--dark {
  border-color: rgba(255, 255, 255, .36);
}

.phone-visual__media,
.screenshot-media {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: inherit;
}

.screenshot-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  min-width: 0;
  min-height: 0;
  display: block;
  object-fit: fill;
  object-position: center;
  animation: editorial-media-enter 240ms var(--ease-editorial) both;
}

.screenshot-media__fallback {
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  min-height: 180px;
  padding: 24px;
  display: grid;
  place-content: center;
  gap: 8px;
  color: var(--figma-muted);
  border: 1px dashed var(--brand);
  border-radius: inherit;
  background: #fff;
  text-align: center;
}

.screenshot-media__fallback span {
  font-size: 12px;
}

.screenshot-media__fallback strong {
  color: var(--figma-copy);
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
}

@keyframes editorial-media-enter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (min-width: 901px) {
  /* Preserve the two-line Figma rhythm while allowing longer descriptions to
     push the controls down instead of colliding with them. */
  .editorial-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }

  .screen-kicker,
  .editorial-copy h2,
  .active-feature-description,
  .feature-tabs-slot,
  .feature-separator,
  .feature-group-detail {
    position: relative;
    top: auto;
    left: auto;
    flex: 0 0 auto;
  }

  .screen-kicker {
    align-self: flex-start;
  }

  .editorial-copy h2 {
    margin-top: .9375cqw;
  }

  .active-feature-description {
    min-height: 4.6875cqw;
    margin-top: .729167cqw;
  }

  .feature-tabs-slot {
    margin-top: 1.276041cqw;
  }

  .feature-separator {
    margin-top: 1.276042cqw;
  }

  .feature-group-detail,
  .feature-section--settings .feature-group-detail {
    margin-top: 1.25cqw;
  }

  .feature-section--settings .feature-separator {
    margin-top: 2.181283cqw;
  }
}

@media (max-width: 900px) {
  .feature-section {
    padding: 0;
  }

  .editorial-layout {
    position: relative;
    width: var(--mobile-canvas-width);
    height: 100dvh;
    aspect-ratio: auto;
    margin: 0 auto;
    overflow: hidden;
    container-type: inline-size;
    display: block;
  }

  .editorial-layout::before {
    left: 1.956%;
    top: 63.611111cqw;
    width: 48.35%;
  }

  .editorial-layout::after {
    left: 5.16%;
    top: 123.478704cqw;
    width: 94.84%;
    height: 69.325556cqw;
  }

  .editorial-media {
    position: absolute;
    z-index: 2;
    left: 0;
    top: 76.880556cqw;
    width: 100%;
    height: min(127.656296cqw, calc(100dvh - 76.880556cqw));
    margin: 0;
    display: flex;
    justify-content: center;
  }

  .editorial-copy {
    position: absolute;
    z-index: 3;
    top: 20.277778cqw;
    left: 0;
    width: 100%;
    height: 24.9%;
  }

  .phone-visual {
    position: relative;
    width: auto;
    height: 100%;
    aspect-ratio: 636.574 / 1378.688;
    flex: 0 0 auto;
    border-width: .103cqw;
    border-radius: 6.172cqw;
    box-shadow: 0 3.086cqw 3.086cqw 3.086cqw rgba(134, 98, 253, .05);
  }

  .screen-kicker {
    position: absolute;
    top: 0;
    left: 4.259%;
    min-width: 17.5926cqw;
    height: 5.975cqw;
    padding: 0 2.778cqw;
    border-radius: 0 3.519cqw 3.519cqw 0;
    font-size: 3.319cqw;
  }

  .editorial-copy h2 {
    position: absolute;
    top: 6.822cqw;
    left: 4.259%;
    margin: 0;
    color: #000;
    font-size: 9.2787cqw;
    line-height: 1.5;
    white-space: nowrap;
  }

  .active-feature-description {
    position: absolute;
    top: 21.656cqw;
    left: 4.259%;
    width: 89.9%;
    max-width: none;
    margin: 0;
    color: var(--figma-copy);
    font-size: 4.1667cqw;
    line-height: 1.5;
  }

  .feature-tabs-slot {
    position: absolute;
    top: 40.032cqw;
    left: 4.259%;
    width: 95.741%;
    margin: 0;
    overflow: hidden;
  }

  .feature-tabs {
    width: 100%;
    max-width: 100%;
    gap: 2.806cqw;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    padding-right: 4.259cqw;
  }

  .feature-section--settings .feature-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  .feature-tabs button {
    min-width: 20.824cqw;
    min-height: 9.89525cqw;
    padding: 0 4.63cqw;
    scroll-snap-align: center;
    border-width: .103cqw;
    border-radius: 14.77cqw;
    font-size: 3.5446cqw;
  }

  .feature-separator {
    display: none;
  }

  .feature-group-detail {
    display: none;
  }

  .screen-panel--dark .editorial-copy h2,
  .screen-panel--dark .feature-group-detail h3 {
    color: #fff;
  }

  .screen-panel--dark .active-feature-description {
    color: #b9b3bf;
  }

  .screenshot-media {
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    aspect-ratio: auto;
  }

  .screenshot-media img {
    top: -.28%;
    bottom: auto;
    height: 100.32%;
    max-height: none;
  }
}

@media (max-width: 520px) {
  .feature-section {
    padding: 0;
  }

  .editorial-layout {
    width: var(--mobile-canvas-width);
  }

}

@media (prefers-reduced-motion: reduce) {
  .phone-visual,
  .feature-tabs button,
  .screenshot-media img {
    transform: none !important;
    transition: none !important;
    animation: none !important;
  }
}
