/*
 * Web4 Browser product feature pages.
 * This layer intentionally excludes the shared header, breadcrumbs,
 * call-action download strip and footer.
 */
body.web4-template-feature {
  --w4f-blue: #1263f5;
  --w4f-blue-strong: #0757e6;
  --w4f-navy: #062654;
  --w4f-ink: #081b3a;
  --w4f-copy: #586b88;
  --w4f-muted: #7485a0;
  --w4f-line: #d8e5f7;
  --w4f-soft: #f5f8fd;
  --w4f-radius: 8px;
  --w4f-shadow: 0 18px 44px rgba(7, 35, 78, .08);
}

body.web4-template-feature main {
  overflow: clip;
  background: #fff;
}

/*
 * Feature content must remain readable without waiting for a scroll observer.
 * Existing site motion may still enhance controls, but it cannot hide sections.
 */
body.web4-template-feature.web4-secondary-redesign.motion-ready main [data-motion] {
  opacity: 1 !important;
  transform: none !important;
  will-change: auto !important;
}

body.web4-template-feature main > .feature-detail-section {
  position: relative;
  padding: 76px 0 !important;
}

body.web4-template-feature main > .feature-detail-section.white {
  background: #fff !important;
}

body.web4-template-feature main > .feature-detail-section.soft {
  padding: 76px 0 !important;
  border-top: 1px solid #edf3fb;
  border-bottom: 1px solid #edf3fb;
  background: linear-gradient(180deg, #f8fbff 0%, #f3f7fd 100%) !important;
}

/* Legacy feature hero: restore a true two-column layout. */
body.web4-template-feature main > .feature-detail-section:first-of-type {
  padding: 70px 0 82px !important;
  background:
    linear-gradient(rgba(18, 99, 245, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(18, 99, 245, .035) 1px, transparent 1px),
    linear-gradient(180deg, #fff 0%, #f6f9ff 100%) !important;
  background-size: 56px 56px, 56px 56px, auto !important;
}

body.web4-template-feature main > .feature-detail-section:first-of-type > .container {
  display: block !important;
  min-height: 0 !important;
}

body.web4-template-feature main > .feature-detail-section:first-of-type > .container > .row,
body.web4-template-feature main > .feature-detail-section:first-of-type .feature-hero-card > .row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 1fr);
  gap: clamp(36px, 5vw, 68px);
  align-items: center;
  margin: 0;
}

body.web4-template-feature main > .feature-detail-section:first-of-type :is(.col-lg-5, .col-lg-6, .col-lg-7) {
  display: block !important;
  width: 100% !important;
  max-width: none;
  padding: 0;
}

body.web4-template-feature main > .feature-detail-section:first-of-type .text-center {
  max-width: 860px;
  margin: 0 auto 38px;
  text-align: center !important;
}

body.web4-template-feature main > .feature-detail-section:first-of-type .feature-kicker {
  margin-bottom: 14px;
}

body.web4-template-feature main > .feature-detail-section:first-of-type .feature-title {
  max-width: 760px;
  margin: 0 0 18px;
  font-size: clamp(34px, 3.5vw, 48px);
  line-height: 1.14;
  letter-spacing: 0;
  text-wrap: balance;
  overflow-wrap: normal;
  word-break: normal;
}

body.web4-template-feature main > .feature-detail-section:first-of-type .text-center .feature-title {
  margin-right: auto;
  margin-left: auto;
}

body.web4-template-feature main > .feature-detail-section:first-of-type .feature-lead {
  max-width: 720px;
  margin: 0;
  color: var(--w4f-copy);
  font-size: 17px;
  line-height: 1.78;
}

body.web4-template-feature main > .feature-detail-section:first-of-type .text-center .feature-lead {
  margin-right: auto;
  margin-left: auto;
}

body.web4-template-feature main > .feature-detail-section:first-of-type .feature-hero-card {
  margin: 0 !important;
  padding: clamp(24px, 3vw, 38px) !important;
  overflow: hidden;
  border: 1px solid #cbdcf4 !important;
  border-radius: var(--w4f-radius) !important;
  background: rgba(255, 255, 255, .96) !important;
  box-shadow: 0 24px 58px rgba(7, 35, 78, .11) !important;
}

body.web4-template-feature main > .feature-detail-section:first-of-type .feature-hero-card::before {
  right: -90px;
  bottom: -150px;
  left: auto;
  width: 360px;
  height: 360px;
  opacity: .7;
}

body.web4-template-feature main > .feature-detail-section:first-of-type .feature-visual {
  min-height: 360px !important;
  height: auto !important;
  margin: 0 !important;
  padding: clamp(22px, 3vw, 38px);
  border: 1px solid #d9e6f8 !important;
  border-radius: var(--w4f-radius) !important;
  background: linear-gradient(145deg, #fff 0%, #edf4ff 100%);
  box-shadow: none !important;
}

body.web4-template-feature main > .feature-detail-section:first-of-type .feature-visual img {
  display: block;
  width: min(100%, 540px);
  height: auto !important;
  max-height: 340px;
  object-fit: contain;
}

body.web4-template-feature main > .feature-detail-section:first-of-type .feature-command {
  padding: 26px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: var(--w4f-radius);
  background: var(--w4f-navy);
  box-shadow: 0 18px 38px rgba(6, 38, 84, .16);
}

body.web4-template-feature main > .feature-detail-section:first-of-type .feature-command code {
  color: #dceaff;
}

/* Shared section titles inside feature content. */
body.web4-template-feature main > .feature-detail-section .feature-kicker {
  padding: 6px 12px;
  border: 1px solid #c9ddff;
  border-radius: 999px;
  background: #edf4ff;
  color: var(--w4f-blue);
  font-size: 13px;
  font-weight: 800;
}

body.web4-template-feature main > .feature-detail-section .feature-title {
  max-width: 820px;
  color: var(--w4f-ink);
  font-size: clamp(29px, 3vw, 38px);
  line-height: 1.22;
  text-wrap: balance;
}

body.web4-template-feature main > .feature-detail-section .feature-lead {
  color: var(--w4f-copy);
  line-height: 1.75;
}

/* Capability and workflow cards. */
body.web4-template-feature main > .feature-detail-section :is(
  .feature-mini-card,
  .feature-use-card,
  .feature-step,
  .feature-panel,
  .feature-comparison
) {
  border: 1px solid var(--w4f-line) !important;
  border-radius: var(--w4f-radius) !important;
  background: #fff;
  box-shadow: 0 10px 28px rgba(7, 35, 78, .045) !important;
}

body.web4-template-feature main > .feature-detail-section :is(
  .feature-mini-card,
  .feature-use-card,
  .feature-step
) {
  min-height: 210px !important;
  padding: 28px !important;
  transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

body.web4-template-feature main > .feature-detail-section :is(
  .feature-mini-card,
  .feature-use-card,
  .feature-step
):hover {
  transform: translateY(-4px);
  border-color: #a9c8f7 !important;
  box-shadow: var(--w4f-shadow) !important;
}

body.web4-template-feature main > .feature-detail-section :is(
  .feature-mini-card i,
  .feature-use-card i,
  .feature-step .num
) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin-bottom: 20px;
  border-radius: 8px;
  background: #eaf2ff;
  color: var(--w4f-blue);
  font-size: 22px;
}

body.web4-template-feature main > .feature-detail-section :is(
  .feature-mini-card h3,
  .feature-use-card h3,
  .feature-step h3
) {
  margin: 0 0 10px;
  color: var(--w4f-ink);
  font-size: 19px;
  line-height: 1.35;
}

body.web4-template-feature main > .feature-detail-section :is(
  .feature-mini-card p,
  .feature-use-card p,
  .feature-step p
) {
  margin: 0;
  color: var(--w4f-copy);
  font-size: 15px;
  line-height: 1.7;
}

body.web4-template-feature main > .feature-detail-section .feature-metric-grid,
body.web4-template-feature main > .feature-detail-section .feature-use-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px !important;
  border: 0 !important;
}

body.web4-template-feature main > .feature-detail-section .feature-step-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

/* Five-step operating path. */
body.web4-template-feature main > .web4-feature-workflow {
  padding: 72px 0 !important;
  border-top: 1px solid #edf3fb;
  border-bottom: 1px solid #edf3fb;
  background: #fff !important;
}

body.web4-template-feature main > .web4-feature-workflow .section-title {
  max-width: 820px;
  margin: 0 auto 36px;
  text-align: center !important;
}

body.web4-template-feature main > .web4-feature-workflow .section-title h3 {
  display: block;
  margin-bottom: 10px;
  color: var(--w4f-blue);
  font-size: 13px;
  font-weight: 800;
}

body.web4-template-feature main > .web4-feature-workflow .section-title h2 {
  justify-content: center;
  font-size: clamp(28px, 3vw, 36px);
}

body.web4-template-feature main > .web4-feature-workflow-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

body.web4-template-feature main > .web4-feature-workflow-grid::before {
  content: "";
  position: absolute;
  top: 34px;
  right: 9%;
  left: 9%;
  z-index: 0;
  border-top: 2px dashed #b9d1fa;
}

body.web4-template-feature main > .web4-feature-workflow .feature-step {
  position: relative;
  z-index: 1;
  min-height: 130px !important;
  padding: 18px 12px !important;
  text-align: center;
}

body.web4-template-feature main > .web4-feature-workflow .feature-step strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin-bottom: 14px;
  border: 6px solid #fff;
  border-radius: 50%;
  background: var(--w4f-blue);
  color: #fff;
  box-shadow: 0 0 0 1px #bdd3f8;
}

/* Closing panels and comparison tables. */
body.web4-template-feature main > .feature-detail-section .feature-split-alt {
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr) !important;
  gap: 24px !important;
  align-items: stretch;
}

body.web4-template-feature main > .feature-detail-section .feature-panel {
  min-height: 100%;
  padding: clamp(28px, 4vw, 44px) !important;
}

body.web4-template-feature main > .feature-detail-section .feature-panel h2 {
  color: var(--w4f-ink);
  font-size: clamp(26px, 3vw, 34px);
  line-height: 1.25;
}

body.web4-template-feature main > .feature-detail-section .feature-comparison {
  overflow: hidden;
}

body.web4-template-feature main > .feature-detail-section .feature-comparison-row {
  display: grid;
  grid-template-columns: minmax(120px, .72fr) repeat(2, minmax(0, 1fr)) !important;
  min-height: 64px;
  border-bottom: 1px solid var(--w4f-line);
}

body.web4-template-feature main > .feature-detail-section .feature-comparison-row:last-child {
  border-bottom: 0;
}

body.web4-template-feature main > .feature-detail-section .feature-comparison-row > div {
  padding: 18px 20px;
}

body.web4-template-feature main > .feature-detail-section .feature-comparison-row.header {
  background: #eaf2ff;
}

/* Bespoke workspace pages keep their information architecture, with homepage finish. */
body.web4-template-feature main > .ma-page {
  --ma-blue: var(--w4f-blue);
  --ma-navy: var(--w4f-navy);
  --ma-ink: var(--w4f-ink);
  --ma-copy: var(--w4f-copy);
  --ma-line: var(--w4f-line);
}

body.web4-template-feature main > .ma-page .ma-hero {
  border-bottom: 1px solid var(--w4f-line);
  background-color: #f7faff;
}

body.web4-template-feature main > .ma-page :is(
  .ma-workspace,
  .ma-context-board,
  .ma-process-step,
  .ma-cap-item,
  .ma-platform-card
) {
  border-radius: var(--w4f-radius);
  border-color: var(--w4f-line);
}

body.web4-template-feature main > .ma-page .ma-workspace {
  box-shadow: 0 24px 58px rgba(7, 35, 78, .11);
}

/* Locale-safe title scaling. */
html:is([lang^="de"], [lang^="ru"], [lang^="fr"], [lang^="pt"])
  body.web4-template-feature
  main
  > .feature-detail-section:first-of-type
  .feature-title {
  font-size: clamp(31px, 3vw, 43px);
  hyphens: auto;
}

@media (max-width: 991px) {
  body.web4-template-feature main > .feature-detail-section:first-of-type > .container > .row,
  body.web4-template-feature main > .feature-detail-section:first-of-type .feature-hero-card > .row {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  body.web4-template-feature main > .feature-detail-section:first-of-type .feature-visual {
    min-height: 300px !important;
  }

  body.web4-template-feature main > .feature-detail-section .feature-step-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.web4-template-feature main > .web4-feature-workflow-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body.web4-template-feature main > .web4-feature-workflow-grid::before {
    display: none;
  }
}

@media (max-width: 767px) {
  body.web4-template-feature main > .feature-detail-section,
  body.web4-template-feature main > .feature-detail-section.soft,
  body.web4-template-feature main > .web4-feature-workflow {
    padding: 52px 0 !important;
  }

  body.web4-template-feature main > .feature-detail-section:first-of-type {
    padding: 48px 0 56px !important;
  }

  body.web4-template-feature main > .feature-detail-section:first-of-type .feature-title,
  html:is([lang^="de"], [lang^="ru"], [lang^="fr"], [lang^="pt"])
    body.web4-template-feature
    main
    > .feature-detail-section:first-of-type
    .feature-title {
    font-size: clamp(30px, 9vw, 38px);
    line-height: 1.14;
  }

  body.web4-template-feature main > .feature-detail-section:first-of-type .feature-lead {
    font-size: 16px;
  }

  body.web4-template-feature main > .feature-detail-section:first-of-type .feature-hero-card {
    padding: 18px !important;
  }

  body.web4-template-feature main > .feature-detail-section:first-of-type .feature-visual {
    min-height: 230px !important;
    padding: 16px;
  }

  body.web4-template-feature main > .feature-detail-section .feature-metric-grid,
  body.web4-template-feature main > .feature-detail-section .feature-use-grid,
  body.web4-template-feature main > .feature-detail-section .feature-step-grid,
  body.web4-template-feature main > .web4-feature-workflow-grid,
  body.web4-template-feature main > .feature-detail-section .feature-split-alt {
    grid-template-columns: 1fr !important;
  }

  body.web4-template-feature main > .feature-detail-section :is(
    .feature-mini-card,
    .feature-use-card,
    .feature-step
  ) {
    min-height: 0 !important;
  }

  body.web4-template-feature main > .web4-feature-workflow .feature-step {
    display: grid;
    grid-template-columns: 52px 1fr;
    align-items: center;
    min-height: 84px !important;
    text-align: left;
  }

  body.web4-template-feature main > .web4-feature-workflow .feature-step strong {
    grid-row: 1 / span 2;
    margin: 0;
  }

  body.web4-template-feature main > .feature-detail-section .feature-comparison-row {
    grid-template-columns: 1fr !important;
  }

  body.web4-template-feature main > .feature-detail-section .feature-comparison-row > div {
    padding: 14px 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.web4-template-feature main > .feature-detail-section *,
  body.web4-template-feature main > .feature-detail-section *::before,
  body.web4-template-feature main > .feature-detail-section *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
