/*
 * Product pages: /features/, the feature pages, /pricing/, /integrations/.
 * Builds on legal.css (header, footer, buttons) and app-window.css (product
 * visuals). Tokens only — no raw colors (design-system-contract.test.ts).
 */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.button--light {
  border-color: var(--color-border-default);
  background: var(--color-surface-raised);
  color: var(--color-text-primary);
}

.button--light:hover {
  border-color: var(--color-border-strong);
}

.product-main {
  width: 100%;
  overflow-x: clip;
}

/* ---------------------------------------------------------------- hero -- */

.product-hero {
  position: relative;
  padding: 136px 20px 88px;
  background:
    linear-gradient(
      180deg,
      var(--color-overlay-white-28) 0%,
      var(--color-overlay-snow-80) 46%,
      var(--color-surface-canvas) 78%
    ),
    url("/images/generated/sphen-polar-hero-e870b6ef.webp") 58% top / 100% auto
      no-repeat;
}

.product-hero::after {
  position: absolute;
  inset: auto 0 0;
  height: 1px;
  background: var(--color-border-subtle);
  content: "";
}

.product-hero__inner {
  display: grid;
  width: min(1180px, 100%);
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.25fr);
  align-items: center;
  gap: clamp(32px, 5vw, 72px);
  margin: 0 auto;
}

.product-hero--stacked .product-hero__inner {
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
}

.product-hero--feature .product-hero__inner {
  grid-template-columns: minmax(0, 1fr);
  gap: 56px;
}

.product-hero--feature .product-hero__copy {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: end;
  column-gap: clamp(32px, 6vw, 96px);
}

.product-hero--feature .product-hero__lede {
  padding-bottom: 6px;
}

.product-hero--feature .product-lead {
  margin-top: 0;
}

.product-hero--compact {
  padding-bottom: 72px;
}

.product-hero__copy--center {
  max-width: 820px;
  text-align: center;
}

.product-hero__copy--center .product-breadcrumb {
  justify-content: center;
}

.product-hero__media--wide {
  width: min(1080px, 100%);
}

.product-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
  color: var(--color-text-tertiary);
  font-size: var(--text-caption);
}

.product-breadcrumb a {
  color: var(--color-text-secondary);
  text-decoration: underline;
  text-decoration-color: var(--color-signal-underline);
  text-underline-offset: 3px;
}

.product-kicker {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  margin: 0 0 18px;
  padding: 7px 13px;
  border: 1px solid var(--color-overlay-ink-14);
  border-radius: var(--radius-pill);
  background: var(--color-surface-glass-soft);
  color: var(--color-text-secondary);
  font-size: var(--text-caption);
  font-weight: 750;
  text-transform: uppercase;
  backdrop-filter: blur(12px);
}

.product-title {
  margin: 0;
  color: var(--color-text-primary);
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 4.6vw, 3.75rem);
  font-weight: 560;
  letter-spacing: -0.03em;
  line-height: 1.02;
  text-wrap: balance;
}

.product-lead {
  max-width: 60ch;
  margin: 22px 0 0;
  color: var(--color-text-secondary);
  font-size: var(--text-lead);
  line-height: 1.6;
  text-wrap: pretty;
}

.product-hero__copy--center .product-lead {
  margin-inline: auto;
}

.product-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.product-actions--center {
  justify-content: center;
}

/* ------------------------------------------------------------- sections -- */

.product-section {
  padding: clamp(72px, 10vw, 128px) 20px;
}

.product-section + .product-section {
  border-top: 1px solid var(--color-border-subtle);
}

.product-section__inner {
  width: min(1120px, 100%);
  margin: 0 auto;
}

.product-section h2 {
  max-width: 22ch;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.6vw, 3rem);
  font-weight: 520;
  letter-spacing: -0.03em;
  line-height: 1.05;
  text-wrap: balance;
}

.product-eyebrow {
  margin: 0 0 16px;
  color: var(--color-text-tertiary);
  font-size: var(--text-caption);
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* problem */

.product-problem {
  background: var(--color-surface-subtle);
}

.product-problem__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 48px;
}

.product-problem__grid article {
  padding: 28px;
  border: 1px solid var(--color-border-subtle);
  border-radius: 14px;
  background: var(--color-surface-raised);
}

.product-problem__grid h3,
.product-step h3,
.product-card h3,
.integration-card h3 {
  margin: 0 0 10px;
  font-size: 1.125rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.product-problem__grid p,
.product-step p,
.product-card p,
.integration-card p {
  margin: 0;
  color: var(--color-text-secondary);
  line-height: 1.6;
}

/* how it works */

.product-steps {
  display: grid;
  gap: clamp(56px, 8vw, 104px);
  margin: 64px 0 0;
  padding: 0;
  list-style: none;
}

.product-step {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  align-items: center;
  gap: clamp(28px, 5vw, 72px);
}

.product-step:nth-child(even) .product-step__copy {
  order: 2;
}

.product-step__copy {
  max-width: 440px;
}

.product-step__index {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  margin-bottom: 18px;
  border: 1px solid var(--color-border-signal-soft);
  border-radius: 50%;
  background: var(--color-signal-wash);
  color: var(--color-text-primary);
  font-size: var(--text-caption);
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.product-step h3 {
  font-size: 1.5rem;
  line-height: 1.2;
}

.product-step p {
  font-size: 1.0625rem;
}

/* control */

.product-control__inner,
.product-plans__inner,
.product-faq__inner {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  align-items: start;
  gap: clamp(32px, 6vw, 88px);
}

.product-checklist {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.product-checklist li {
  position: relative;
  padding: 18px 20px 18px 52px;
  border: 1px solid var(--color-border-subtle);
  border-radius: 12px;
  background: var(--color-surface-raised);
  font-size: 1.0625rem;
  line-height: 1.5;
}

.product-checklist li::before {
  position: absolute;
  top: 19px;
  left: 18px;
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 50%;
  background: var(--color-brand-signal);
  color: var(--color-text-primary);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  content: "✓";
}

/* plans */

.product-plans {
  background: var(--color-surface-subtle);
}

.product-plans__inner {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

.product-plans__inner > .button {
  justify-self: end;
}

.product-plans__label {
  margin: 20px 0 16px;
  color: var(--color-text-secondary);
}

.product-quota {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.product-quota li {
  display: grid;
  min-width: 140px;
  gap: 4px;
  padding: 16px 18px;
  border: 1px solid var(--color-border-subtle);
  border-radius: 12px;
  background: var(--color-surface-raised);
}

.product-quota strong {
  color: var(--color-text-tertiary);
  font-size: var(--text-caption);
  font-weight: 700;
  text-transform: uppercase;
}

.product-quota span {
  font-size: 1.75rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* faq */

.product-guide {
  display: inline-block;
  margin-top: 24px;
  color: var(--color-text-primary);
  font-weight: 650;
  text-decoration: underline;
  text-decoration-color: var(--color-signal-underline);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.product-faq {
  border-top: 1px solid var(--color-border-default);
}

.product-faq details {
  border-bottom: 1px solid var(--color-border-default);
}

.product-faq summary {
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  font-size: 1.0625rem;
  font-weight: 600;
  list-style: none;
}

.product-faq summary::-webkit-details-marker {
  display: none;
}

.product-faq summary::after {
  flex: none;
  font-size: 1.25rem;
  font-weight: 400;
  content: "+";
  transition: transform var(--duration-fast) var(--ease-out);
}

.product-faq details[open] summary::after {
  transform: rotate(45deg);
}

.product-faq summary:focus-visible {
  outline: 3px solid var(--color-focus-ring);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px var(--color-focus-contrast);
}

.product-faq p {
  max-width: 64ch;
  margin: 0 0 24px;
  color: var(--color-text-secondary);
  line-height: 1.65;
}

/* related */

.product-related__head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.product-related__head a {
  font-weight: 650;
  text-decoration: underline;
  text-decoration-color: var(--color-signal-underline);
  text-underline-offset: 4px;
}

.product-related__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 36px;
}

.product-related__card {
  display: grid;
  gap: 12px;
  align-content: start;
  min-height: 170px;
  padding: 24px;
  border: 1px solid var(--color-border-subtle);
  border-radius: 14px;
  background: var(--color-surface-raised);
  text-decoration: none;
  transition:
    border-color var(--duration-fast) var(--ease-out),
    transform var(--duration-fast) var(--ease-out);
}

.product-related__card:hover {
  border-color: var(--color-border-strong);
  transform: translateY(-2px);
}

.product-related__card span {
  color: var(--color-text-tertiary);
  font-size: var(--text-caption);
  font-weight: 750;
  text-transform: uppercase;
}

.product-related__card strong {
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.3;
}

/* closing */

.product-closing {
  padding: clamp(88px, 12vw, 152px) 20px;
  border-top: 1px solid var(--color-border-subtle);
  background:
    radial-gradient(
      ellipse at 50% 0%,
      var(--color-overlay-ice-32) 0%,
      transparent 62%
    ),
    var(--color-surface-canvas);
  text-align: center;
}

.product-closing__inner {
  width: min(760px, 100%);
  margin: 0 auto;
}

.product-closing img {
  margin: 0 auto 24px;
}

.product-closing h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 4.4vw, 3.5rem);
  font-weight: 540;
  letter-spacing: -0.03em;
  line-height: 1.04;
  text-wrap: balance;
}

.product-closing p {
  margin: 18px auto 0;
  color: var(--color-text-secondary);
  font-size: var(--text-lead);
}

/* ----------------------------------------------------------------- hub -- */

.product-loop__list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 48px 0 0;
  padding: 0;
  border: 1px solid var(--color-border-subtle);
  border-radius: 14px;
  background: var(--color-surface-raised);
  list-style: none;
}

.product-loop__list li {
  position: relative;
  padding: 28px 24px;
}

.product-loop__list li + li {
  border-left: 1px solid var(--color-border-subtle);
}

.product-loop__list span {
  color: var(--color-text-tertiary);
  font-size: var(--text-caption);
  font-weight: 750;
}

.product-loop__list h3 {
  margin: 10px 0 8px;
  font-size: 1.375rem;
  font-weight: 620;
}

.product-loop__list p {
  margin: 0;
  color: var(--color-text-secondary);
  line-height: 1.55;
}

.product-grid-section {
  background: var(--color-surface-subtle);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 40px;
}

.product-grid--three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.product-card {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--color-border-subtle);
  border-radius: 16px;
  background: var(--color-surface-raised);
  text-decoration: none;
  transition:
    border-color var(--duration-fast) var(--ease-out),
    transform var(--duration-base) var(--ease-out),
    box-shadow var(--duration-base) var(--ease-out);
}

.product-card:hover {
  border-color: var(--color-border-strong);
  box-shadow: 0 24px 60px -36px var(--color-shadow-strong);
  transform: translateY(-3px);
}

.product-card:focus-visible,
.product-related__card:focus-visible {
  outline: 3px solid var(--color-focus-ring);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px var(--color-focus-contrast);
}

.product-card__media {
  padding: 24px 24px 0;
  background: linear-gradient(
    180deg,
    var(--color-surface-tinted-soft) 0%,
    var(--color-surface-raised) 100%
  );
}

.product-card__media .app-window__frame {
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
  box-shadow: 0 18px 40px -30px var(--color-shadow-strong);
}

.product-card__media .app-window__caption {
  display: none;
}

.product-card__copy {
  display: grid;
  gap: 10px;
  padding: 24px 28px 28px;
  border-top: 1px solid var(--color-border-subtle);
}

.product-card__copy span {
  color: var(--color-text-tertiary);
  font-size: var(--text-caption);
  font-weight: 750;
  text-transform: uppercase;
}

.product-card__copy h3 {
  margin: 0;
  font-size: 1.375rem;
  line-height: 1.2;
}

.product-card__copy strong {
  margin-top: 6px;
  font-size: var(--text-label);
}

/* ------------------------------------------------------------- pricing -- */

.price-grid {
  display: grid;
  width: min(1080px, 100%);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.price-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 28px;
  border: 1px solid var(--color-border-default);
  border-radius: 16px;
  background: var(--color-surface-raised);
  text-align: left;
}

.price-card--featured {
  border-color: var(--color-text-primary);
  box-shadow: 0 30px 70px -40px var(--color-shadow-strong);
}

.price-card h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 650;
}

.price-card__price {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 8px 0 0;
}

.price-card__price strong {
  font-size: 3rem;
  font-weight: 560;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.price-card__price span,
.price-card__trial {
  color: var(--color-text-secondary);
}

.price-card__trial {
  margin: 0;
  font-size: var(--text-label);
}

.price-card ul {
  display: grid;
  flex: 1;
  gap: 10px;
  margin: 16px 0 24px;
  padding: 16px 0 0;
  border-top: 1px solid var(--color-border-subtle);
  list-style: none;
}

.price-card li {
  color: var(--color-text-secondary);
  line-height: 1.4;
}

.price-card li strong {
  color: var(--color-text-primary);
  font-variant-numeric: tabular-nums;
}

.price-managed {
  display: flex;
  width: min(1080px, 100%);
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 28px;
  border: 1px dashed var(--color-border-strong);
  border-radius: 16px;
  background: var(--color-surface-glass);
  text-align: left;
}

.price-managed h2 {
  margin: 0 0 6px;
  font-size: 1.125rem;
}

.price-managed p {
  margin: 0;
  color: var(--color-text-secondary);
}

.price-table__wrap {
  margin-top: 36px;
  overflow-x: auto;
  border: 1px solid var(--color-border-subtle);
  border-radius: 14px;
  background: var(--color-surface-raised);
}

.price-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.price-table th,
.price-table td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border-subtle);
  text-align: right;
}

.price-table th[scope="row"],
.price-table thead th:first-child {
  text-align: left;
}

.price-table thead th {
  background: var(--color-surface-subtle);
  font-size: var(--text-label);
}

.price-table th[scope="row"] {
  color: var(--color-text-secondary);
  font-weight: 500;
}

.price-table tbody tr:last-child > * {
  border-bottom: 0;
}

.price-notes {
  display: grid;
  gap: 6px;
  margin: 20px 0 0;
  padding-left: 18px;
  color: var(--color-text-tertiary);
  font-size: var(--text-label);
}

/* -------------------------------------------------------- integrations -- */

.integration-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.integration-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px;
  border: 1px solid var(--color-border-subtle);
  border-radius: 14px;
  background: var(--color-surface-raised);
}

.integration-card p {
  flex: 1;
}

.integration-card a {
  font-size: var(--text-label);
  font-weight: 650;
  text-decoration: underline;
  text-decoration-color: var(--color-signal-underline);
  text-underline-offset: 3px;
}

.integration-card__direction {
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: var(--text-caption);
  font-weight: 700;
}

.integration-card__direction--read {
  background: var(--color-surface-blue-soft);
  color: var(--color-text-primary);
}

.integration-card__direction--write {
  background: var(--color-brand-signal-soft);
  color: var(--color-text-primary);
}

.integration-card__direction--publish {
  background: var(--color-status-success-soft);
  color: var(--color-text-primary);
}

/* -------------------------------------------------------------- mobile -- */

@media (max-width: 980px) {
  .product-hero--feature .product-hero__copy {
    grid-template-columns: minmax(0, 1fr);
  }

  .product-hero--feature .product-lead {
    margin-top: 22px;
  }

  .product-hero__inner,
  .product-step,
  .product-control__inner,
  .product-plans__inner,
  .product-faq__inner {
    grid-template-columns: minmax(0, 1fr);
  }

  .product-step:nth-child(even) .product-step__copy {
    order: 0;
  }

  .product-plans__inner > .button {
    justify-self: start;
  }

  .integration-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .product-loop__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .product-loop__list li:nth-child(3) {
    border-left: 0;
  }

  .product-loop__list li:nth-child(n + 3) {
    border-top: 1px solid var(--color-border-subtle);
  }
}

@media (max-width: 760px) {
  /* The walkthrough needs height more than width on a phone. */
  .product-hero .app-window {
    --stage-ratio: 0.92 !important;
  }

  .product-hero {
    padding: calc(112px + env(safe-area-inset-top)) 16px 56px;
    background-size: auto 520px;
  }

  .product-section {
    padding-inline: 16px;
  }

  .product-problem__grid,
  .product-related__grid,
  .product-grid,
  .product-grid--three,
  .price-grid,
  .integration-grid,
  .product-loop__list {
    grid-template-columns: minmax(0, 1fr);
  }

  .product-loop__list li + li {
    border-top: 1px solid var(--color-border-subtle);
    border-left: 0;
  }

  .price-managed {
    flex-direction: column;
    align-items: flex-start;
  }

  .product-related__head {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ------------------------------------------------ feature hierarchy -- */

.product-card h3 a {
  color: inherit;
  text-decoration: none;
}

.product-card h3 a:hover {
  text-decoration: underline;
  text-decoration-color: var(--color-signal-underline);
  text-underline-offset: 4px;
}

.product-card__media {
  display: block;
}

.product-card__features {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.product-card__features a {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-pill);
  background: var(--color-surface-subtle);
  color: var(--color-text-primary);
  font-size: var(--text-label);
  font-weight: 600;
  text-decoration: none;
  transition:
    border-color var(--duration-fast) var(--ease-out),
    background-color var(--duration-fast) var(--ease-out);
}

.product-card__features a:hover {
  border-color: var(--color-border-strong);
  background: var(--color-surface-raised);
}

.product-card__features a:focus-visible,
.product-card__more:focus-visible,
.product-card h3 a:focus-visible,
.product-child:focus-visible {
  outline: 3px solid var(--color-focus-ring);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px var(--color-focus-contrast);
}

.product-card__more {
  margin-top: 10px;
  color: var(--color-text-primary);
  font-size: var(--text-label);
  font-weight: 650;
  text-decoration: underline;
  text-decoration-color: var(--color-signal-underline);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.product-children {
  background: var(--color-surface-canvas);
}

.product-children__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
  margin-top: 40px;
}

.product-child {
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  border: 1px solid var(--color-border-subtle);
  border-radius: 14px;
  background: var(--color-surface-raised);
  color: var(--color-text-primary);
  text-decoration: none;
  transition:
    border-color var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-base) var(--ease-out),
    transform var(--duration-base) var(--ease-out);
}

.product-child:hover {
  border-color: var(--color-border-strong);
  box-shadow: 0 22px 48px -32px var(--color-shadow-strong);
  transform: translateY(-3px);
}

.product-child__media {
  display: block;
  overflow: hidden;
  aspect-ratio: 1.6;
  border-bottom: 1px solid var(--color-border-subtle);
  background: var(--color-neutral-75);
}

.product-child__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 0%;
  transition: object-position 1800ms var(--ease-standard);
}

.product-child:hover .product-child__media img {
  object-position: 50% 40%;
}

.product-child__copy {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 20px 20px;
}

.product-child__copy span {
  color: var(--color-text-tertiary);
  font-size: var(--text-caption);
  font-weight: 750;
  text-transform: uppercase;
}

.product-child__copy strong {
  font-size: 1.0625rem;
  font-weight: 620;
  line-height: 1.3;
}

.product-child__copy em {
  margin-top: auto;
  padding-top: 6px;
  font-size: var(--text-label);
  font-style: normal;
  font-weight: 650;
}

/* --------------------------------------------------------- comparisons -- */

.compare-vs {
  color: var(--color-text-tertiary);
  font-weight: 400;
}

.compare-coverage {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.compare-coverage--center {
  justify-content: center;
}

.compare-coverage div {
  display: grid;
  min-width: 190px;
  gap: 2px;
  padding: 14px 16px;
  border: 1px solid var(--color-border-subtle);
  border-radius: 12px;
  background: var(--color-surface-glass);
  text-align: left;
}

.compare-coverage strong {
  font-size: 1.5rem;
  font-weight: 620;
  font-variant-numeric: tabular-nums;
}

.compare-coverage span {
  color: var(--color-text-secondary);
  font-size: var(--text-caption);
  line-height: 1.4;
}

.compare-checked {
  margin: 16px 0 0;
  color: var(--color-text-tertiary);
  font-size: var(--text-caption);
}

.compare-note,
.compare-method {
  max-width: 70ch;
  margin: 18px 0 0;
  color: var(--color-text-secondary);
  line-height: 1.6;
}

.compare-answer {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 36px;
}

.compare-answer article {
  padding: 28px;
  border: 1px solid var(--color-border-subtle);
  border-radius: 14px;
  background: var(--color-surface-raised);
}

.compare-answer__sphen {
  border-color: var(--color-border-signal-soft) !important;
  box-shadow: 0 0 0 3px var(--color-signal-wash);
}

.compare-answer h3 {
  margin: 0 0 10px;
  font-size: 1.125rem;
}

.compare-answer p {
  margin: 0;
  color: var(--color-text-secondary);
  line-height: 1.6;
}

.compare-table__wrap {
  margin-top: 32px;
  overflow-x: auto;
  border: 1px solid var(--color-border-subtle);
  border-radius: 14px;
  background: var(--color-surface-raised);
}

.compare-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
}

.compare-table th,
.compare-table td {
  padding: 18px 20px;
  border-bottom: 1px solid var(--color-border-subtle);
  text-align: left;
  vertical-align: top;
}

.compare-table thead th {
  background: var(--color-surface-subtle);
  font-size: var(--text-label);
}

.compare-table tbody tr:last-child > * {
  border-bottom: 0;
}

.compare-table th[scope="row"] {
  display: grid;
  gap: 4px;
  font-weight: 400;
}

.compare-table th[scope="row"] strong {
  font-weight: 620;
}

.compare-table th[scope="row"] small {
  color: var(--color-text-secondary);
  font-size: var(--text-caption);
  line-height: 1.5;
}

.compare-row__link {
  margin-top: 4px;
  color: var(--color-text-primary);
  font-size: var(--text-caption);
  font-weight: 650;
  text-decoration: underline;
  text-decoration-color: var(--color-signal-underline);
  text-underline-offset: 3px;
}

.status {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 0 10px;
  border-radius: var(--radius-pill);
  font-size: var(--text-caption);
  font-weight: 700;
  white-space: nowrap;
}

.status--sphen {
  background: var(--color-brand-signal);
  color: var(--color-text-primary);
}

.status--yes {
  background: var(--color-status-success-soft);
  color: var(--color-text-primary);
}

.status--unknown {
  background: var(--color-surface-subtle);
  color: var(--color-text-tertiary);
}

.compare-inapp {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 36px;
}

.compare-inapp__card {
  display: grid;
  gap: 12px;
  color: var(--color-text-primary);
  font-weight: 650;
  text-decoration: none;
}

.compare-inapp__card:hover span {
  text-decoration: underline;
  text-decoration-color: var(--color-signal-underline);
  text-underline-offset: 4px;
}

.compare-inapp__card .app-window__caption {
  display: none;
}

.compare-sources p {
  margin: 0 0 14px;
  color: var(--color-text-secondary);
  line-height: 1.6;
}

.compare-sources p strong {
  color: var(--color-text-primary);
}

.compare-sources ul {
  display: grid;
  gap: 6px;
  margin: 0 0 28px;
  padding-left: 18px;
}

.compare-sources li a {
  display: inline-block;
  min-height: 28px;
  padding: 4px 0;
}

.compare-sources a {
  color: var(--color-text-primary);
  text-decoration: underline;
  text-decoration-color: var(--color-signal-underline);
  text-underline-offset: 3px;
}

.compare-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 36px;
}

.compare-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px;
  border: 1px solid var(--color-border-subtle);
  border-radius: 14px;
  background: var(--color-surface-raised);
  color: var(--color-text-primary);
  text-decoration: none;
  transition:
    border-color var(--duration-fast) var(--ease-out),
    transform var(--duration-base) var(--ease-out);
}

.compare-card:hover {
  border-color: var(--color-border-strong);
  transform: translateY(-2px);
}

.compare-card:focus-visible,
.compare-inapp__card:focus-visible {
  outline: 3px solid var(--color-focus-ring);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px var(--color-focus-contrast);
}

.compare-card__meta {
  color: var(--color-text-tertiary);
  font-size: var(--text-caption);
  font-weight: 650;
}

.compare-card strong {
  font-size: 1.0625rem;
  line-height: 1.3;
}

.compare-card__summary {
  display: -webkit-box;
  overflow: hidden;
  color: var(--color-text-secondary);
  font-size: var(--text-label);
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.compare-card__coverage {
  margin-top: auto;
  color: var(--color-text-secondary);
  font-size: var(--text-caption);
  font-weight: 650;
}

.compare-card em {
  font-size: var(--text-label);
  font-style: normal;
  font-weight: 650;
}

@media (max-width: 980px) {
  .compare-grid,
  .compare-inapp {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .compare-grid,
  .compare-inapp,
  .compare-answer {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ------------------------------------------------------ signature layer --
   Page rhythm shared with the homepage: full-bleed colour bands instead of
   hairlines, display headings at the homepage weight, large tinted cards
   and the mascot closing. Tokens only. */

.product-title {
  font-weight: 450;
  letter-spacing: -0.04em;
  line-height: 1;
}

.product-section + .product-section {
  border-top: 0;
}

.product-section h2 {
  max-width: 20ch;
  font-size: clamp(2.25rem, 4vw, 3.25rem);
  font-weight: 450;
  letter-spacing: -0.04em;
  line-height: 1.02;
}

.product-eyebrow {
  color: var(--color-text-muted);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.22em;
}

/* bands */
.product-problem,
.product-loop {
  background: var(--color-surface-tinted);
}

.product-how,
.product-related,
.product-split {
  background: var(--color-surface-raised);
}

.product-plans,
.product-faq-section,
.product-grid-section {
  background: var(--color-surface-muted);
}

.product-control {
  background: var(--color-surface-inverse);
  color: var(--color-text-inverse);
}

.product-control h2 {
  color: var(--color-text-inverse);
}

.product-control .product-eyebrow,
.product-control p {
  color: var(--color-text-inverse-muted);
}

.product-control .product-checklist li {
  border-color: var(--color-border-inverse-subtle);
  background: var(--color-overlay-white-06);
  color: var(--color-text-inverse);
}

.product-control a:not(.button) {
  color: var(--color-text-inverse);
}

/* dark band on the comparison pages carries light cards */
.product-control .compare-answer article,
.product-control .compare-coverage div {
  color: var(--color-text-primary);
}

.product-control .compare-answer article p,
.product-control .compare-coverage span {
  color: var(--color-text-secondary);
}

/* cards */
.product-problem__grid {
  gap: 20px;
  margin-top: 56px;
}

.product-problem__grid article {
  padding: 36px 32px;
  border: 0;
  border-radius: 24px;
  box-shadow:
    0 1px 2px var(--color-overlay-ink-04),
    0 18px 44px var(--color-overlay-ocean-08);
}

.product-problem__grid h3 {
  font-size: 1.375rem;
  font-weight: 550;
  letter-spacing: -0.02em;
}

.product-steps {
  gap: 24px;
}

.product-step {
  padding: clamp(28px, 4.4vw, 56px);
  border: 1px solid var(--color-border-subtle);
  border-radius: 28px;
  background: var(--color-surface-tinted);
}

.product-step:nth-child(4n + 2) {
  background: var(--color-overlay-signal-10);
}

.product-step:nth-child(4n + 3) {
  background: var(--color-surface-muted);
}

.product-step:nth-child(4n + 4) {
  background: var(--color-surface-blue-soft);
}

.product-step__index {
  width: auto;
  height: auto;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--color-deep-ocean);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.product-step h3 {
  font-size: clamp(1.625rem, 2.6vw, 2.125rem);
  font-weight: 450;
  letter-spacing: -0.035em;
  line-height: 1.08;
  text-wrap: balance;
}

.product-step p {
  font-size: 1rem;
}

.product-loop__list {
  gap: 16px;
  border: 0;
  background: none;
}

.product-loop__list li,
.product-loop__list li + li {
  padding: 32px 28px;
  border: 0;
  border-radius: 24px;
  background: var(--color-surface-raised);
  box-shadow:
    0 1px 2px var(--color-overlay-ink-04),
    0 18px 44px var(--color-overlay-ocean-08);
}

.product-loop__list span {
  color: var(--color-deep-ocean);
  font-weight: 500;
  letter-spacing: 0.08em;
}

.product-loop__list h3 {
  font-size: 1.75rem;
  font-weight: 450;
  letter-spacing: -0.03em;
}

.product-card,
.product-child,
.product-related__card,
.compare-card,
.integration-card {
  border-radius: 20px;
}

.product-quota li {
  min-width: 168px;
  padding: 22px 24px;
  border: 0;
  border-radius: 20px;
}

.product-quota span {
  font-size: 2.5rem;
  font-weight: 450;
  letter-spacing: -0.04em;
}

/* pricing */
.price-grid {
  gap: 20px;
}

.price-card {
  padding: 36px 32px;
  border-radius: 24px;
}

.price-card__price strong {
  font-size: 3.75rem;
  font-weight: 450;
  letter-spacing: -0.05em;
}

.price-card--featured {
  border-color: var(--color-surface-inverse);
  background: var(--color-surface-inverse);
  color: var(--color-text-inverse);
  box-shadow: 0 40px 80px -36px var(--color-shadow-strong);
}

.price-card--featured .price-card__price span,
.price-card--featured .price-card__trial,
.price-card--featured li {
  color: var(--color-text-inverse-muted);
}

.price-card--featured li strong {
  color: var(--color-text-inverse);
}

.price-card--featured ul {
  border-top-color: var(--color-border-inverse-subtle);
}

.price-card--featured .button {
  background: var(--color-surface-raised);
  color: var(--color-polar-ink);
}

.price-card--featured .button:hover {
  background: var(--color-emperor-orange);
}

.price-managed {
  border-radius: 24px;
}

/* closing */
.product-closing {
  padding: clamp(56px, 8vw, 96px) 24px 24px;
  border-top: 0;
  background: var(--color-surface-muted);
  text-align: left;
}

.product-closing__inner {
  position: relative;
  display: flex;
  overflow: hidden;
  width: min(1240px, 100%);
  min-height: 520px;
  flex-direction: column;
  justify-content: center;
  padding: 88px 72px;
  border-radius: 36px;
  background: var(--color-mascot-black);
  color: var(--color-text-inverse);
}

.product-closing__inner > * {
  position: relative;
}

.product-closing img.product-closing__mascot {
  position: absolute;
  right: 0;
  bottom: 0;
  width: min(44%, 500px);
  height: auto;
  margin: 0;
  mask-image: linear-gradient(
    90deg,
    transparent 0%,
    var(--color-mascot-black) 22%
  );
}

.product-closing h2 {
  max-width: 14ch;
  font-size: clamp(2.5rem, 4.8vw, 4rem);
  font-weight: 450;
  letter-spacing: -0.04em;
  line-height: 1;
}

.product-closing p {
  max-width: 440px;
  margin: 20px 0 0;
  color: var(--color-text-inverse-muted);
}

.product-closing .button--dark {
  background: var(--color-surface-raised);
  color: var(--color-polar-ink);
}

.product-closing .button--dark:hover {
  background: var(--color-emperor-orange);
}

.product-closing .button--light {
  border-color: var(--color-border-inverse-subtle);
  background: var(--color-overlay-white-06);
  color: var(--color-text-inverse);
}

@media (max-width: 760px) {
  .product-step {
    border-radius: 20px;
  }

  .product-loop__list li,
  .product-loop__list li + li {
    padding: 24px 22px;
    border-radius: 18px;
  }

  .product-closing {
    padding: 56px 12px 12px;
  }

  .product-closing__inner {
    min-height: 0;
    justify-content: flex-start;
    padding: 56px 24px 300px;
    border-radius: 24px;
  }

  .product-closing img.product-closing__mascot {
    right: 50%;
    width: 300px;
    transform: translateX(50%);
    mask-image: none;
  }
}

/* answer-first block */
.product-answer {
  padding-top: clamp(56px, 7vw, 88px);
  padding-bottom: clamp(56px, 7vw, 88px);
  background: var(--color-surface-raised);
}

.product-answer__inner {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  align-items: start;
  gap: clamp(28px, 6vw, 88px);
}

.product-answer h2 {
  font-size: clamp(1.75rem, 2.8vw, 2.375rem);
  line-height: 1.08;
}

.product-answer__text {
  margin: 0;
  padding-left: 24px;
  border-left: 3px solid var(--color-emperor-orange);
  color: var(--color-text-primary);
  font-size: clamp(1.125rem, 1.6vw, 1.375rem);
  line-height: 1.5;
  letter-spacing: -0.01em;
  text-wrap: pretty;
}

.product-updated {
  margin: 18px 0 0;
  padding-left: 27px;
  color: var(--color-text-muted);
  font-size: var(--text-caption);
}

/* in the app */
.product-details {
  background: var(--color-surface-tinted);
}

.product-details__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 56px;
}

.product-details__grid article {
  padding: 36px 32px;
  border-radius: 24px;
  background: var(--color-surface-raised);
  box-shadow:
    0 1px 2px var(--color-overlay-ink-04),
    0 18px 44px var(--color-overlay-ocean-08);
}

.product-details__grid span {
  display: block;
  margin-bottom: 40px;
  color: var(--color-deep-ocean);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.product-details__grid h3 {
  margin: 0 0 12px;
  font-size: 1.375rem;
  font-weight: 550;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.product-details__grid p {
  margin: 0;
  color: var(--color-text-secondary);
  line-height: 1.6;
}

/* a problem band directly after the answer keeps its own colour; the
   details band is tinted, so the control band after it stays dark. */
.product-answer + .product-problem {
  background: var(--color-surface-muted);
}

@media (max-width: 980px) {
  .product-answer__inner {
    grid-template-columns: minmax(0, 1fr);
  }

  .product-details__grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .product-details__grid article {
    padding: 28px 24px;
    border-radius: 18px;
  }

  .product-details__grid span {
    margin-bottom: 24px;
  }
}

/* features hub: four phases */
.product-phase__inner {
  display: grid;
  grid-template-columns: minmax(0, 0.42fr) minmax(0, 1fr);
  align-items: start;
  gap: clamp(28px, 5vw, 72px);
}

.product-phase__copy {
  position: sticky;
  top: 112px;
}

.product-phase__copy > p:last-child {
  max-width: 34ch;
  margin: 18px 0 0;
  color: var(--color-text-secondary);
  font-size: 1.0625rem;
  line-height: 1.55;
}

.product-phase .product-grid {
  margin-top: 0;
}

.product-phase--1 {
  background: var(--color-surface-raised);
}

.product-phase--2 {
  background: var(--color-surface-tinted);
}

.product-phase--3 {
  background: var(--color-surface-inverse);
}

.product-phase--3 .product-phase__copy h2 {
  color: var(--color-text-inverse);
}

.product-phase--3 .product-phase__copy p {
  color: var(--color-text-inverse-muted);
}

.product-phase--4 {
  background: var(--color-surface-muted);
}

@media (max-width: 980px) {
  .product-phase__inner {
    grid-template-columns: minmax(0, 1fr);
  }

  .product-phase__copy {
    position: static;
  }
}
