/* Shared Growth components. Load growth-tokens.css first. */

.growth-wrap {
  width: min(var(--growth-layout-wrap), calc(100% - 2 * var(--growth-layout-gutter)));
  margin-inline: auto;
}

.growth-wrap--narrow {
  width: min(var(--growth-layout-wrap-narrow), calc(100% - 2 * var(--growth-layout-gutter)));
}

.growth-section { padding-block: var(--growth-layout-section); }
.growth-band--raised { background: var(--growth-gradient-band); }
.growth-band--sunken { background: var(--growth-color-bg-sunken); }

.growth-section-head {
  display: grid;
  gap: var(--growth-space-4) var(--growth-space-7);
  margin-block-end: var(--growth-space-7);
}

.growth-section-head__aside {
  color: var(--growth-color-text-secondary);
  font-size: var(--growth-font-size-body-lg);
  line-height: var(--growth-line-height-snug);
}

@media (min-width: 900px) {
  .growth-section-head { grid-template-columns: 1.4fr 1fr; align-items: end; }
}

/* Type */
.growth-display, .growth-headline, .growth-title-1, .growth-title-2 {
  font-family: var(--growth-font-family-display);
  font-weight: var(--growth-font-weight-semibold);
  text-wrap: balance;
}

.growth-display {
  font-size: var(--growth-font-size-display);
  line-height: var(--growth-line-height-display);
  letter-spacing: var(--growth-letter-spacing-display);
}

.growth-headline {
  font-size: var(--growth-font-size-headline);
  line-height: var(--growth-line-height-headline);
  letter-spacing: var(--growth-letter-spacing-headline);
}

.growth-title-1, .growth-title-2 {
  line-height: var(--growth-line-height-title);
  letter-spacing: var(--growth-letter-spacing-title);
}

.growth-title-1 { font-size: var(--growth-font-size-title-1); }
.growth-title-2 { font-size: var(--growth-font-size-title-2); }
.growth-display em { color: var(--growth-color-accent); font-style: normal; }
.growth-headline em { color: var(--growth-color-text-tertiary); font-style: normal; }

@supports ((background-clip: text) or (-webkit-background-clip: text)) {
  .growth-display em {
    background-image: var(--growth-gradient-text-accent);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}

.growth-eyebrow {
  color: var(--growth-color-accent);
  font-size: var(--growth-font-size-eyebrow);
  font-weight: var(--growth-font-weight-semibold);
  line-height: var(--growth-line-height-snug);
  letter-spacing: var(--growth-letter-spacing-eyebrow);
  text-transform: uppercase;
}

.growth-eyebrow + :is(.growth-display, .growth-headline) { margin-block-start: var(--growth-space-4); }
.growth-lead, .growth-body { color: var(--growth-color-text-secondary); text-wrap: pretty; }
.growth-lead { font-size: var(--growth-font-size-body-lg); line-height: 1.55; }
.growth-body { font-size: var(--growth-font-size-body); line-height: var(--growth-line-height-body); }
.growth-caption {
  color: var(--growth-color-text-tertiary);
  font-size: var(--growth-font-size-caption);
  line-height: var(--growth-line-height-snug);
}
.growth-measure { max-width: var(--growth-layout-measure); }

/* Focus and links */
:where(.growth-btn, .growth-link, .growth-prose-link, .growth-skip, .growth-tile--link,
       .growth-input, .growth-select, .growth-textarea, .growth-check input, .growth-faq summary):focus-visible {
  outline: var(--growth-focus-width) solid var(--growth-color-focus);
  outline-offset: var(--growth-focus-offset);
}

.growth-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--growth-space-4) var(--growth-space-6);
}

.growth-prose-link, .growth-link {
  color: var(--growth-color-accent);
  text-underline-offset: 0.2em;
}

.growth-link {
  display: inline-flex;
  gap: var(--growth-space-2);
  align-items: center;
  min-block-size: var(--growth-size-target);
  min-inline-size: var(--growth-size-target);
  font-weight: var(--growth-font-weight-semibold);
}

:is(.growth-prose-link, .growth-link):hover { color: var(--growth-color-accent-hover); }

/* Buttons */
.growth-btn {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--growth-space-2);
  min-block-size: var(--growth-size-control);
  min-inline-size: var(--growth-size-target);
  max-inline-size: 100%;
  padding: var(--growth-space-3) var(--growth-space-5);
  border: 1px solid var(--growth-color-control-border);
  border-radius: var(--growth-radius-pill);
  background: var(--growth-color-surface);
  color: var(--growth-color-text);
  font: inherit;
  font-weight: var(--growth-font-weight-semibold);
  line-height: var(--growth-line-height-snug);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: border-color var(--growth-motion-duration-hover) var(--growth-motion-ease-standard),
              transform var(--growth-motion-duration-press) var(--growth-motion-ease-out);
}

.growth-btn--primary {
  border-color: var(--growth-color-accent);
  background: var(--growth-gradient-accent);
  color: var(--growth-color-text-on-accent);
  box-shadow: var(--growth-shadow-sheen), var(--growth-shadow-1);
}

.growth-btn--primary:enabled:hover, a.growth-btn--primary:hover { background: var(--growth-gradient-accent-hover); }
.growth-btn--secondary { background: var(--growth-material-glass-raised); }
.growth-btn--secondary:hover {
  border-color: var(--growth-color-accent);
  background: var(--growth-color-surface-raised);
}
.growth-btn--light { background: var(--growth-color-text); color: var(--growth-color-text-on-accent); }
.growth-btn--light:hover { background: var(--growth-color-accent-hover); }

.growth-btn--sm {
  min-block-size: var(--growth-size-target);
  padding: var(--growth-space-2) var(--growth-space-4);
  font-size: var(--growth-font-size-small);
}

@media (prefers-reduced-motion: no-preference) {
  .growth-btn:enabled:active, a.growth-btn:active { transform: scale(0.98); }
}

.growth-btn:disabled {
  border-color: var(--growth-color-line-strong);
  background: var(--growth-color-surface);
  color: var(--growth-color-text-tertiary);
  box-shadow: none;
  cursor: default;
}

/* Tiles and chips */
.growth-tile, .growth-cta {
  position: relative;
  min-inline-size: 0;
  padding: clamp(var(--growth-space-5), 4vw, var(--growth-space-7));
  border: 1px solid var(--growth-color-line);
  border-radius: var(--growth-radius-lg);
  background: var(--growth-color-surface) var(--growth-gradient-surface);
  color: var(--growth-color-text);
  box-shadow: var(--growth-shadow-sheen), var(--growth-shadow-1);
}

.growth-tile--feature, .growth-cta { background-image: var(--growth-gradient-surface-raised); }
.growth-tile--quiet { background: none; box-shadow: none; border-color: var(--growth-color-line-strong); }
.growth-tile--keyline::before {
  content: "";
  position: absolute;
  inset: 0 var(--growth-space-5) auto;
  block-size: 1px;
  background: var(--growth-gradient-keyline);
  pointer-events: none;
}

.growth-tile--link {
  display: block;
  min-block-size: var(--growth-size-target);
  text-decoration: none;
  transition: border-color var(--growth-motion-duration-hover) var(--growth-motion-ease-standard);
}
.growth-tile--link:hover { border-color: var(--growth-color-accent); }
.growth-tile__text { color: var(--growth-color-text-secondary); text-wrap: pretty; }

.growth-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--growth-space-2);
  padding: var(--growth-space-1) var(--growth-space-3);
  border: 1px solid var(--growth-color-accent-line);
  border-radius: var(--growth-radius-pill);
  background: var(--growth-color-accent-soft);
  color: var(--growth-color-accent);
  font-size: var(--growth-font-size-small);
  line-height: var(--growth-line-height-snug);
}

.growth-cta { display: grid; gap: var(--growth-space-5) var(--growth-space-7); }
@media (min-width: 900px) {
  .growth-cta { grid-template-columns: 1fr auto; align-items: center; }
}

/* Fields */
.growth-field { display: grid; gap: var(--growth-space-2); min-inline-size: 0; }
.growth-label { font-size: var(--growth-font-size-small); font-weight: var(--growth-font-weight-semibold); }
.growth-input, .growth-select, .growth-textarea {
  box-sizing: border-box;
  inline-size: 100%;
  min-inline-size: 0;
  min-block-size: var(--growth-size-control);
  padding: var(--growth-space-3) var(--growth-space-4);
  border: 1px solid var(--growth-color-control-border);
  border-radius: var(--growth-radius-sm);
  background: var(--growth-color-bg);
  color: var(--growth-color-text);
  font: inherit;
  line-height: var(--growth-line-height-snug);
}

.growth-input { text-overflow: ellipsis; }
.growth-textarea { min-block-size: var(--growth-space-10); resize: vertical; }
.growth-select option { background: var(--growth-color-bg-raised); color: var(--growth-color-text); }
:is(.growth-input, .growth-textarea)::placeholder { color: var(--growth-color-text-tertiary); opacity: 1; }
:is(.growth-input, .growth-select, .growth-textarea):enabled:hover { border-color: var(--growth-color-accent); }
.growth-hint, .growth-error { font-size: var(--growth-font-size-small); line-height: var(--growth-line-height-snug); }
.growth-hint { color: var(--growth-color-text-secondary); }
.growth-error { color: var(--growth-color-danger); }
:is(.growth-input, .growth-select, .growth-textarea)[aria-invalid="true"] {
  border-color: var(--growth-color-danger);
  background: linear-gradient(var(--growth-color-danger-soft), var(--growth-color-danger-soft)) var(--growth-color-bg);
}

.growth-check {
  box-sizing: border-box;
  display: flex;
  align-items: flex-start;
  gap: var(--growth-space-3);
  min-block-size: var(--growth-size-target);
  padding-block: var(--growth-space-2);
  cursor: pointer;
}

.growth-check input {
  flex: none;
  inline-size: var(--growth-space-4);
  block-size: var(--growth-space-4);
  accent-color: var(--growth-color-accent);
}

/* FAQ */
.growth-faq { border-block-start: 1px solid var(--growth-color-line-strong); }
.growth-faq details { border-block-end: 1px solid var(--growth-color-line-strong); }
.growth-faq summary {
  box-sizing: border-box;
  min-block-size: var(--growth-size-target);
  padding-block: var(--growth-space-4);
  font-weight: var(--growth-font-weight-semibold);
  cursor: pointer;
}
.growth-faq summary:hover { color: var(--growth-color-accent); }
.growth-faq__answer {
  max-width: var(--growth-layout-measure);
  padding-block-end: var(--growth-space-5);
  color: var(--growth-color-text-secondary);
}

/* Utilities */
.growth-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.growth-skip {
  box-sizing: border-box;
  position: absolute;
  inset: var(--growth-space-3) auto auto var(--growth-space-3);
  z-index: var(--growth-layer-overlay);
  display: inline-flex;
  align-items: center;
  min-block-size: var(--growth-size-target);
  padding-inline: var(--growth-space-4);
  border-radius: var(--growth-radius-pill);
  background: var(--growth-color-accent);
  color: var(--growth-color-text-on-accent);
  font-weight: var(--growth-font-weight-semibold);
  transform: translateY(-200%);
}
.growth-skip:focus { transform: none; }

@media (forced-colors: active) {
  .growth-btn, .growth-tile, .growth-chip, .growth-cta { border-color: ButtonText; }
  .growth-btn:disabled { border-color: GrayText; color: GrayText; }
  .growth-display em { background: none; color: inherit; }

  .growth-check input[type="checkbox"] {
    appearance: none;
    display: grid;
    place-items: center;
    border: 1px solid ButtonText;
    border-radius: 2px;
    background: Canvas;
    forced-color-adjust: none;
  }

  .growth-check input[type="checkbox"]:checked {
    border-color: Highlight;
    background: Highlight;
  }

  .growth-check input[type="checkbox"]:checked::after {
    content: "";
    inline-size: 0.3rem;
    block-size: 0.55rem;
    border: solid HighlightText;
    border-width: 0 2px 2px 0;
    transform: translateY(-1px) rotate(45deg);
  }
}

@media print {
  .growth-tile, .growth-cta, .growth-btn, .growth-chip {
    background: none;
    border-color: currentColor;
    box-shadow: none;
  }
  .growth-tile, .growth-cta, .growth-btn, .growth-chip, .growth-display em, .growth-headline em,
  .growth-lead, .growth-body, .growth-caption, .growth-eyebrow, .growth-tile__text, .growth-faq__answer {
    color: CanvasText;
  }
  .growth-display em { background: none; }
  .growth-skip { display: none; }
}
