/* Homepage sections following the animated product story.
   These styles deliberately stay scoped away from the hero and workflow. */
.home-section,
.home-pilot {
  --home-ink: #201c1d;
  --home-muted: #6b6663;
  --home-line: #e2ddd7;
  --home-accent: #72000e;
  scroll-margin-top: 24px;
}

.home-section.home-engine {
  position: relative;
  isolation: isolate;
  display: grid;
  align-items: center;
  min-height: 0;
  padding: 88px 0;
  overflow: hidden;
  background: #171719;
  color: #faf8f4;
  scroll-margin-top: 72px;
}

.home-engine-background,
.home-engine-background::after,
.home-engine-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.home-engine-background {
  z-index: -1;
  pointer-events: none;
  background: #171719 url("/assets/engine-poster.jpg") center / cover no-repeat;
}

.home-engine-video {
  object-fit: cover;
  object-position: center;
}

.home-engine-background::after {
  content: "";
  /* Keep the wider text block readable while the video remains visible. */
  background: linear-gradient(90deg, rgba(17, 17, 20, .96) 0%, rgba(17, 17, 20, .91) 32%, rgba(17, 17, 20, .84) 65%, rgba(17, 17, 20, .64) 100%),
    linear-gradient(0deg, rgba(17, 17, 20, .36), transparent 30%, transparent 75%, rgba(17, 17, 20, .16));
}

.home-engine-copy { min-width: 0; max-width: 900px; }

.home-engine-copy h2 {
  max-width: 820px;
  margin: 0 0 28px;
  color: #faf8f4;
  font: 500 clamp(38px, 3.8vw, 54px)/1.1 var(--font-display);
  letter-spacing: -.045em;
  text-wrap: balance;
}

.home-engine-copy > p {
  margin: 0;
  color: #e0ddda;
  font-size: 17px;
  line-height: 1.7;
}

.home-engine-copy > p + p { margin-top: 18px; }

@media (max-width: 860px) {
  .home-section.home-engine { padding: 80px 0; }
  .home-engine-background { background-position: 55% center; }
  .home-engine-video { object-position: 55% center; }
  .home-engine-background::after {
    background: linear-gradient(90deg, rgba(17, 17, 20, .89), rgba(17, 17, 20, .77)),
      linear-gradient(0deg, rgba(17, 17, 20, .34), transparent 65%);
  }
}

@media (max-width: 540px) {
  .home-section.home-engine { padding: 64px 0; }
  .home-engine-copy h2 { margin-bottom: 24px; font-size: 35px; }
  .home-engine-copy > p { font-size: 16px; }
  .home-engine-copy > p + p { margin-top: 16px; }
}

.home-section {
  padding: 108px 0;
  color: var(--home-ink);
}

.home-use-cases { background: #faf9f6; }
.home-comparison { background: #fff; border-top: 1px solid var(--home-line); }

.home-problem {
  background: #f1eeea;
  scroll-margin-top: 72px;
}

.home-problem-layout {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  align-items: center;
  gap: clamp(48px, 7vw, 108px);
}

.home-problem-copy h2 {
  margin: 0;
  font: 500 clamp(36px, 3.8vw, 54px)/1.08 var(--font-display);
  letter-spacing: -.045em;
}

.home-problem-description {
  max-width: 580px;
  margin: 28px 0 0;
  color: var(--home-muted);
  font-size: 18px;
  line-height: 1.65;
}

.home-problem-stat {
  margin: 0;
  text-align: right;
}

.home-problem-number {
  color: var(--home-accent);
  font: 500 clamp(140px, 14vw, 210px)/.95 var(--font-display);
  letter-spacing: -.075em;
}

.home-problem-number span { font-size: .76em; }

.home-problem-stat figcaption > p {
  max-width: 390px;
  margin: 24px 0 0 auto;
  color: var(--home-muted);
  font-size: 18px;
  line-height: 1.55;
}

.home-section-intro {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 64px;
  align-items: end;
  margin-bottom: 52px;
}

.home-section-intro h2,
.home-pilot h2 {
  margin: 0;
  font: 500 clamp(36px, 3.5vw, 48px)/1.1 var(--font-display);
  letter-spacing: -.045em;
}

.home-section-intro > p {
  max-width: 450px;
  margin: 0 0 3px auto;
  color: var(--home-muted);
  font-size: 17px;
  line-height: 1.65;
}

.home-use-cases { scroll-margin-top: 60px; }

.use-case-wrap { width: 100%; }
.use-case-heading { width: var(--wrap); margin: 0 auto 40px; text-align: center; }

.use-case-heading h2 {
  margin: 0;
  font: 500 clamp(34px, 3.3vw, 46px)/1.15 var(--font-display);
  letter-spacing: -.045em;
}

.use-case-heading > p {
  margin: 16px 0 0;
  color: var(--home-muted);
  font-size: 15px;
  line-height: 1.5;
}

.use-case-grid {
  --case-gap: 20px;
  /* Keep text wrapping consistent instead of stretching cards at each breakpoint. */
  --case-width: 256px;
  --case-inset: clamp(44px, 5.5vw, 100px);
  position: relative;
  display: grid;
  grid-template-columns: none;
  grid-auto-flow: column;
  grid-auto-columns: var(--case-width);
  gap: var(--case-gap);
  padding-inline: var(--case-inset);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-padding-inline: var(--case-inset);
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overflow-anchor: none;
}

.use-case-grid::-webkit-scrollbar { display: none; }
.use-case-grid:focus-visible { outline: 2px solid var(--home-accent); outline-offset: -2px; }

.use-case-card {
  display: grid;
  grid-template-rows: auto 72px auto auto;
  row-gap: 18px;
  min-width: 0;
  padding: 24px 20px 20px;
  border: 1px solid var(--home-line);
  border-radius: 12px;
  background: #fff;
  scroll-snap-align: start;
}

.use-case-card h3 {
  min-height: 2.44em;
  margin: 0;
  font: 500 22px/1.22 var(--font-display);
  letter-spacing: -.035em;
  text-wrap: balance;
}

.use-case-app {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 72px;
  margin: 0;
}

.use-case-app img { width: 72px; height: 72px; flex: 0 0 72px; border-radius: 16px; object-fit: contain; }
.use-case-app > span { min-width: 0; font-size: 14px; font-weight: 500; line-height: 1.4; text-wrap: balance; }

.use-case-label {
  color: var(--home-muted);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.5;
}

.use-case-facts {
  align-self: start;
  width: 100%;
  margin: 0;
  border-collapse: collapse;
  table-layout: fixed;
  text-align: left;
  font-size: 12px;
  line-height: 1.5;
}
.use-case-facts tr { border-top: 1px solid #eeeae6; }
.use-case-facts col:first-child { width: 82px; }
.use-case-facts th,
.use-case-facts td { height: 40px; padding: 10px 0; vertical-align: middle; white-space: nowrap; }
.use-case-facts th { width: 82px; padding-right: 10px; color: var(--home-muted); font-size: 11px; font-weight: 400; }
.use-case-facts td { font-weight: 500; }

.use-case-risk {
  min-height: 112px;
  padding: 14px;
  border-radius: 7px;
  background: #f8f2f1;
}

.use-case-risk .use-case-label { display: block; color: var(--home-accent); line-height: 18px; }
.use-case-risk p { min-height: 60px; margin: 6px 0 0; color: #583c3b; font-size: 14px; line-height: 20px; text-wrap: balance; }
.use-case-controls { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 24px; }
.use-case-controls[hidden] { display: none; }
.use-case-nav {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #cfc7c3;
  border-radius: 50%;
  background: transparent;
  color: var(--home-accent);
  cursor: pointer;
}
.use-case-nav svg { width: 18px; height: 18px; }
.use-case-nav:hover:not(:disabled) { background: #f3e9e8; border-color: var(--home-accent); }
.use-case-nav:focus-visible { outline: 2px solid var(--home-accent); outline-offset: 4px; }
.use-case-nav:disabled { opacity: .3; cursor: default; }

.home-comparison-heading {
  margin: 0 0 52px;
  text-align: center;
  font: 500 clamp(35px, 3.5vw, 48px)/1.12 var(--font-display);
  letter-spacing: -.045em;
}

.home-comparison-questions { margin: 0; }

.home-comparison-questions > div {
  display: grid;
  grid-template-columns: minmax(290px, 1fr) minmax(0, 2fr);
  align-items: center;
  gap: 32px;
  padding: 24px 28px;
  border-top: 1px solid var(--home-line);
}

.home-comparison-questions dt {
  font-size: 16px;
  font-weight: 500;
  line-height: 1.45;
}

.home-comparison-category {
  display: flex;
  align-items: center;
  gap: 20px;
}

.home-comparison-stack,
.home-comparison-brand-mark {
  position: relative;
  flex: 0 0 104px;
  height: 56px;
}

.home-comparison-stack { isolation: isolate; }

.home-comparison-logo {
  position: absolute;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid #e4e2df;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 3px 5px rgb(32 27 24 / 7%), 0 8px 14px rgb(32 27 24 / 5%);
}

.home-comparison-logo:nth-child(1) { z-index: 3; left: 0; top: 10px; transform: rotate(-9deg); }
.home-comparison-logo:nth-child(2) { z-index: 2; left: 29px; top: 5px; transform: rotate(-1deg); }
.home-comparison-logo:nth-child(3) { z-index: 1; left: 58px; top: 0; transform: rotate(8deg); }
.home-comparison-logo img { display: block; width: 28px; height: 28px; object-fit: contain; }

.home-comparison-questions dd {
  margin: 0;
  font: 400 clamp(18px, 1.7vw, 22px)/1.4 var(--font-display);
  letter-spacing: -.02em;
}

.home-comparison-questions > .home-comparison-cyberlytica {
  border: 1px solid #ead8db;
  border-radius: 10px;
  background: #fbf6f6;
  color: var(--home-accent);
}

.home-comparison-questions .home-comparison-brand {
  display: flex;
  align-items: center;
  gap: 20px;
  font: 500 20px/1.3 var(--font-display);
  letter-spacing: -.025em;
}

.home-comparison-brand-mark { display: flex; align-items: center; justify-content: center; }
.home-comparison-brand img { display: block; width: 36px; height: 36px; object-fit: contain; }

.home-risk-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 44px;
  padding: 8px 0 36px;
  border-bottom: 1px solid var(--home-line);
  text-align: left;
}

.home-risk-stat {
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin: 0;
  padding: 0 clamp(18px, 2.5vw, 36px);
}

.home-risk-stat + .home-risk-stat { border-left: 1px solid var(--home-line); }

.home-risk-stat-value {
  position: relative;
  margin: 0 0 18px;
  padding-top: 28px;
  color: var(--home-accent);
  font: 500 clamp(64px, 6.5vw, 92px)/1 var(--font-display);
  letter-spacing: -.065em;
}

.home-risk-stat-percent { font-size: .76em; }

.home-risk-stat-prefix {
  position: absolute;
  top: 0;
  left: 0;
  color: var(--home-muted);
  font: 400 14px/1.5 var(--font-body);
  letter-spacing: normal;
}

.home-risk-stat figcaption {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 22px;
}

.home-risk-stat figcaption > p {
  margin: 0;
  color: var(--home-muted);
  font-size: 16px;
  line-height: 1.55;
}

.home-risk-stat-copy-short { display: none; }

.home-comparison-example {
  margin: 48px auto 0;
  max-width: 850px;
  text-align: center;
}

.home-comparison-sentence {
  margin: 0;
  font: 400 clamp(22px, 2.3vw, 30px)/1.4 var(--font-display);
  letter-spacing: -.025em;
}

.home-comparison-prefix { display: block; color: var(--home-muted); }

/* All endings share one grid cell, reserving the longest phrase's height. */
.home-comparison-endings { display: grid; color: var(--home-accent); }
.home-comparison-endings > span {
  grid-area: 1 / 1;
  opacity: 0;
  visibility: hidden;
  transition: opacity 350ms ease, visibility 0s linear 350ms;
}
.home-comparison-endings > .is-active {
  opacity: 1;
  visibility: visible;
  /* Finish the outgoing fade before revealing the next phrase. */
  transition-delay: 350ms;
}

@media (prefers-reduced-motion: reduce) {
  .home-comparison-endings > span { transition: none; }
}

.home-pilot {
  padding: 88px 0;
  color: #fff;
  background: #590c18;
}

.home-pilot-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 72px;
}

.home-pilot-copy { max-width: 630px; }
.home-pilot-label { margin: 0 0 22px; color: #e5bec3; font-size: 13px; font-weight: 500; }
.home-pilot h2 { margin-bottom: 24px; }
.home-pilot-copy > p:not([class]) { margin: 0; color: #f1dfe2; font-size: 17px; line-height: 1.7; }
.home-pilot-status { margin: 26px 0 0; color: #dfb9bf; font-size: 12px; line-height: 1.8; }

.home-pilot .home-pilot-button {
  flex-shrink: 0;
  gap: 36px;
  min-height: 56px;
  padding: 0 24px;
  background: #fff;
  color: #590c18;
  border-color: #fff;
  border-radius: 4px;
  transition: none;
  transform: none;
}

.home-pilot .home-pilot-button:hover { background: #f4e8ea; border-color: #f4e8ea; }
.home-pilot .home-pilot-button:focus-visible { outline: 2px solid #fff; outline-offset: 5px; }

.home-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 860px) {
  .home-section { padding: 76px 0; }
  .home-problem-layout { grid-template-columns: 1fr; gap: 48px; }
  .home-problem-stat { text-align: left; }
  .home-problem-stat figcaption > p { margin-left: 0; }
  .home-section-intro { grid-template-columns: 1fr; gap: 22px; margin-bottom: 36px; }
  .home-section-intro > p { margin: 0; max-width: 590px; }
  .home-pilot { padding: 68px 0; }
  .home-pilot-inner { flex-direction: column; align-items: flex-start; gap: 32px; }
  .home-comparison-heading { margin-bottom: 36px; }
  .home-comparison-questions > div { grid-template-columns: minmax(290px, 1fr) minmax(0, 1.65fr); gap: 24px; padding: 22px 20px; }
}

@media (max-width: 680px) {
  .home-comparison { text-align: center; }
  .home-risk-stats { margin-top: 32px; padding: 0 0 24px; text-align: center; }
  .home-risk-stat {
    container-type: inline-size;
    padding: 0 clamp(4px, 1.25vw, 8px);
    border-left: 1px solid transparent;
  }
  .home-risk-stat-value {
    margin-bottom: 12px;
    padding-top: 0;
    font-size: clamp(2rem, 10vw, 3.5rem);
    /* Fit the two digits and percent sign to each column's available width. */
    font-size: 58cqi;
    white-space: nowrap;
  }
  .home-risk-stat-prefix { display: none; }
  .home-risk-stat figcaption > p { font-size: .875rem; line-height: 1.45; text-wrap: balance; }
  .home-risk-stat-copy-full { display: none; }
  .home-risk-stat-copy-short { display: inline; }
  .home-comparison-questions > div { grid-template-columns: 1fr; gap: 16px; }
  .home-comparison-questions dt { font-size: 18px; }
  .home-comparison-category,
  .home-comparison-questions .home-comparison-brand { flex-direction: column; gap: 12px; }
  .home-comparison-stack,
  .home-comparison-brand-mark { flex: none; width: 104px; }
}

@media (max-width: 639px) {
  .use-case-grid { --case-gap: 12px; --case-inset: max(20px, calc((100vw - var(--case-width)) / 2)); }
}

@media (max-width: 540px) {
  .home-section { padding: 60px 0; }
  .home-problem-description,
  .home-problem-stat figcaption > p { font-size: 16px; }
  .home-section-intro h2,
  .home-pilot h2 { font-size: 35px; }
  .home-section-intro > p { font-size: 16px; }
  .use-case-heading { text-align: center; margin-bottom: 30px; }
  .home-comparison-questions > div { grid-template-columns: 1fr; gap: 10px; padding: 22px 16px; }
  .home-comparison-questions dd { font-size: 19px; }
  .home-comparison-questions .home-comparison-brand { font-size: 20px; }
  .home-comparison-example { margin-top: 32px; }
  .home-comparison-sentence { font-size: 21px; }
  .home-pilot .home-pilot-button { justify-content: space-between; width: 100%; gap: 20px; }
}
