/* V-009 contact locomotive — luxury wagon + full-bleed ribbons */

.cta-loco {
  --cta-loco-ink: #f4efe6;
  --cta-loco-peach: #d4b38a;
  --cta-loco-cream: #f3eee4;
  --cta-loco-gold: color-mix(in srgb, var(--color-gold, #b9955b) 80%, #e8d5b0);
  position: relative;
  margin: 2.5rem 0 0;
  padding: 4.5rem 0 5.25rem;
  overflow-x: visible;
  scroll-margin-top: calc(var(--site-header-h, 4.5rem) + 0.75rem);
  background: transparent;
}

body.page-palette .page-content > section.cta-loco {
  background:
    radial-gradient(
      ellipse 70% 64% at 50% 46%,
      color-mix(in srgb, var(--color-gold, #b9955b) 12%, transparent),
      transparent 72%
    );
}

.cta-loco__canvas {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 20%, #000 80%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 20%, #000 80%, transparent 100%);
}

.cta-loco__clip {
  position: relative;
  z-index: 1;
  overflow: hidden;
}

.cta-loco__stage {
  position: relative;
  width: min(100% - 1.5rem, 1360px);
  margin-inline: auto;
  overflow: visible;
}

.cta-loco__shell {
  position: relative;
  display: block;
  width: 100%;
  min-height: clamp(16.75rem, 22vw, 21.5rem);
  color: var(--cta-loco-ink);
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb, #fff 10%, transparent) 0%,
      transparent 34%
    ),
    radial-gradient(ellipse 55% 80% at 88% 12%, color-mix(in srgb, var(--cta-loco-peach) 28%, transparent), transparent 48%),
    radial-gradient(ellipse 40% 70% at 8% 90%, color-mix(in srgb, #4a6a8a 22%, transparent), transparent 52%),
    linear-gradient(118deg, #2c333a 0%, #1c2126 46%, #14181c 100%);
  box-shadow:
    0 28px 56px rgba(12, 14, 16, 0.38),
    inset 0 1px 0 color-mix(in srgb, var(--cta-loco-peach) 38%, transparent),
    inset 0 14px 28px color-mix(in srgb, #fff 6%, transparent);
  /*
   * KC Legal 75f534f silhouette: rectangle, ~10px corners, one top-right chamfer,
   * flat floor, blunt vertical right — not a round capsule / rocket nose.
   */
  --cta-loco-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1000 300' preserveAspectRatio='none'%3E%3Cpath fill='%23fff' d='M12 0H785C798 0 808 6 818 16L982 92C994 102 1000 112 1000 126V288C1000 295 995 300 988 300H12C5 300 0 295 0 288V12C0 5 5 0 12 0Z'/%3E%3C/svg%3E");
  -webkit-mask-image: var(--cta-loco-mask);
  mask-image: var(--cta-loco-mask);
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  transform: translate3d(-100vw, 0, 0);
  opacity: 1;
  will-change: transform, opacity;
}

@supports not ((-webkit-mask-image: url("data:image/svg+xml,")) or (mask-image: url("data:image/svg+xml,"))) {
  .cta-loco__shell {
    border-radius: 10px;
    clip-path: polygon(0 0, 80% 0, 100% 36%, 100% 100%, 0 100%);
  }
}

.cta-loco.is-in:not(.has-entered):not(.is-static) .cta-loco__shell {
  animation: cta-loco-enter 1.45s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.cta-loco.is-in:not(.has-entered):not(.is-static) .cta-loco__title {
  animation: cta-loco-fadeinup 1s 0.5s ease both;
}

.cta-loco.is-static .cta-loco__shell,
.cta-loco.has-entered .cta-loco__shell {
  transform: none;
  opacity: 1;
  animation: none;
}

.cta-loco.is-static .cta-loco__title,
.cta-loco.has-entered .cta-loco__title {
  animation: none;
  opacity: 1;
  transform: none;
}

@keyframes cta-loco-enter {
  from {
    opacity: 1;
    transform: translate3d(-100vw, 0, 0);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes cta-loco-fadeinup {
  from {
    opacity: 0;
    transform: translate3d(0, 1.1em, 0);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.cta-loco__body {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(17rem, 0.85fr);
  gap: 1.4rem 2rem;
  align-items: stretch;
  min-height: inherit;
  box-sizing: border-box;
  padding: 2.05rem clamp(1.5rem, 3.2vw, 2.6rem) 1.7rem clamp(1.7rem, 3.6vw, 2.8rem);
}

.cta-loco__copy {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.1rem;
  min-height: 100%;
}

.cta-loco__copy-top {
  margin-left: 20px;
}

.cta-loco__eyebrow {
  margin: 0 0 0.55rem;
  font-family: var(--font-display);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--cta-loco-peach) 72%, #fff);
}

.cta-loco__title {
  margin: 0 0 0.7rem;
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 1.2rem + 1.8vw, 3.05rem);
  line-height: 0.98;
  font-weight: 600;
  color: #fff;
  max-width: 14ch;
}

.cta-loco__title-lead,
.cta-loco__title-accent {
  display: block;
}

.cta-loco__title-accent {
  margin-top: 0.06em;
  color: var(--cta-loco-peach);
  font-size: 1.06em;
}

.cta-loco__who {
  margin: 0 0 0.45rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: color-mix(in srgb, var(--cta-loco-ink) 78%, transparent);
}

.cta-loco__lead {
  margin: 0;
  max-width: 38rem;
  font-size: 1.02rem;
  line-height: 1.5;
  color: color-mix(in srgb, var(--cta-loco-ink) 88%, transparent);
}

.cta-loco__bloom {
  display: block;
  width: 100%;
  max-width: none;
  height: auto;
  margin-top: 0.35rem;
  overflow: visible;
}

.cta-loco__bloom-ray {
  stroke: color-mix(in srgb, var(--cta-loco-peach) 70%, #fff);
  stroke-width: 1;
  stroke-linecap: round;
  opacity: 0.22;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

.cta-loco__bloom-ray:nth-child(odd) {
  opacity: 0.34;
  stroke-width: 1.15;
}

.cta-loco__bloom-line {
  stroke: var(--cta-loco-peach);
  stroke-width: 1.7;
  stroke-linecap: round;
  fill: none;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--cta-loco-peach) 45%, transparent));
}

.cta-loco__bloom-area {
  opacity: 0;
}

.cta-loco__bloom-node {
  fill: var(--cta-loco-peach);
  opacity: 0;
}

.cta-loco__bloom-node--tip {
  fill: #f3eee4;
  stroke: var(--cta-loco-peach);
  stroke-width: 1.2;
}

.cta-loco.is-in .cta-loco__bloom-ray,
.cta-loco.is-static .cta-loco__bloom-ray {
  animation: cta-loco-draw 1.15s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.cta-loco.is-in .cta-loco__bloom-ray:nth-child(1) { animation-delay: 0.18s; }
.cta-loco.is-in .cta-loco__bloom-ray:nth-child(2) { animation-delay: 0.24s; }
.cta-loco.is-in .cta-loco__bloom-ray:nth-child(3) { animation-delay: 0.3s; }
.cta-loco.is-in .cta-loco__bloom-ray:nth-child(4) { animation-delay: 0.36s; }
.cta-loco.is-in .cta-loco__bloom-ray:nth-child(5) { animation-delay: 0.42s; }
.cta-loco.is-in .cta-loco__bloom-ray:nth-child(6) { animation-delay: 0.48s; }
.cta-loco.is-in .cta-loco__bloom-ray:nth-child(7) { animation-delay: 0.54s; }
.cta-loco.is-in .cta-loco__bloom-ray:nth-child(8) { animation-delay: 0.6s; }
.cta-loco.is-in .cta-loco__bloom-ray:nth-child(9) { animation-delay: 0.66s; }

.cta-loco.is-in .cta-loco__bloom-line,
.cta-loco.is-static .cta-loco__bloom-line {
  animation: cta-loco-draw 1.35s 0.28s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.cta-loco.is-in .cta-loco__bloom-area,
.cta-loco.is-static .cta-loco__bloom-area {
  animation: cta-loco-fade 0.9s 0.45s ease forwards;
}

.cta-loco.is-in .cta-loco__bloom-node,
.cta-loco.is-static .cta-loco__bloom-node {
  animation: cta-loco-fade 0.45s 0.7s ease forwards;
}

.cta-loco.is-in .cta-loco__bloom-node:nth-of-type(1) { animation-delay: 0.55s; }
.cta-loco.is-in .cta-loco__bloom-node:nth-of-type(2) { animation-delay: 0.68s; }
.cta-loco.is-in .cta-loco__bloom-node:nth-of-type(3) { animation-delay: 0.82s; }
.cta-loco.is-in .cta-loco__bloom-node--tip { animation-delay: 0.95s; }

@keyframes cta-loco-draw {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes cta-loco-fade {
  to {
    opacity: 1;
  }
}

.cta-loco__actions {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 1.1rem;
  min-height: 0;
  padding-top: 5rem;
  padding-right: 0.75rem;
}

.cta-loco__cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem 1rem;
  margin-top: 0.35rem;
  width: 100%;
}

.cta-loco__pill {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  min-height: 4.5rem;
  padding: 0.5rem 0.5rem 0.5rem 1.35rem;
  border-radius: 999px;
  color: #1a1e22;
  text-decoration: none;
  box-sizing: border-box;
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb, #fff 92%, transparent) 0%,
      color-mix(in srgb, #fff 35%, transparent) 28%,
      transparent 58%
    ),
    linear-gradient(
      165deg,
      #fffdf8 0%,
      color-mix(in srgb, #fff 55%, var(--cta-loco-cream)) 38%,
      color-mix(in srgb, var(--color-gold, #b9955b) 28%, #f0e4d2) 100%
    );
  box-shadow:
    inset 0 1px 0 #fff,
    inset 0 14px 22px color-mix(in srgb, #fff 55%, transparent),
    inset 0 -3px 8px color-mix(in srgb, var(--color-gold, #b9955b) 22%, transparent),
    0 0 0 1px color-mix(in srgb, var(--color-gold, #b9955b) 62%, #8a6a3a),
    0 14px 30px rgba(16, 18, 22, 0.32),
    0 0 40px color-mix(in srgb, var(--color-gold, #b9955b) 38%, transparent);
}

.cta-loco__pill::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: inherit;
  border: 1px solid color-mix(in srgb, var(--color-gold, #b9955b) 52%, transparent);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, #fff 78%, transparent),
    inset 0 0 14px color-mix(in srgb, var(--color-gold, #b9955b) 14%, transparent);
  pointer-events: none;
  z-index: 0;
}

.cta-loco__pill::after {
  content: "";
  position: absolute;
  left: 10%;
  right: 10%;
  top: 6px;
  height: 46%;
  border-radius: 999px;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, #fff 88%, transparent) 0%,
    color-mix(in srgb, #fff 28%, transparent) 55%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 0;
  opacity: 0.85;
}

.cta-loco__pill:hover,
.cta-loco__pill:focus-visible {
  background:
    linear-gradient(
      180deg,
      #fffaf4 0%,
      color-mix(in srgb, #fff 70%, var(--cta-loco-cream)) 52%,
      color-mix(in srgb, var(--color-gold, #b9955b) 16%, #f3ebe0) 100%
    );
  box-shadow:
    inset 0 1px 0 #fff,
    inset 0 -1px 0 color-mix(in srgb, var(--color-gold, #b9955b) 22%, transparent),
    0 0 0 1px color-mix(in srgb, var(--color-gold, #b9955b) 62%, transparent),
    0 14px 32px rgba(16, 18, 22, 0.34),
    0 0 36px color-mix(in srgb, var(--color-gold, #b9955b) 32%, transparent);
}

.cta-loco__pill-copy {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0.12rem;
  min-width: 0;
  flex: 1 1 auto;
}

.cta-loco__pill-kicker {
  font-family: var(--font-display);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: color-mix(in srgb, #1c2024 55%, transparent);
}

.cta-loco__pill-label {
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.15;
  color: #1c2024;
  /* Words may wrap; never break mid-word / by letter. */
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

.cta-loco__mark {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  flex: 0 0 3.35rem;
  width: 3.35rem;
  height: 3.35rem;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, color-mix(in srgb, var(--color-gold) 22%, transparent), transparent 58%),
    radial-gradient(circle at 72% 78%, color-mix(in srgb, var(--color-gold) 14%, transparent), transparent 52%),
    #1a1e22;
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--color-gold) 55%, transparent),
    0 4px 10px rgba(12, 14, 16, 0.28);
}

.cta-loco__mark img {
  position: relative;
  z-index: 1;
  width: 2.2rem;
  height: 2.2rem;
  object-fit: contain;
}

.cta-loco__channels {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  align-items: center;
}

.cta-loco__channel {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  min-height: 2.5rem;
  color: color-mix(in srgb, var(--cta-loco-ink) 78%, transparent);
  font-family: var(--font-display);
  font-size: 0.84rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  padding-bottom: 0.15rem;
  background-image: linear-gradient(
    color-mix(in srgb, var(--cta-loco-peach) 55%, currentColor),
    color-mix(in srgb, var(--cta-loco-peach) 55%, currentColor)
  );
  background-repeat: no-repeat;
  background-position: 1.47rem 100%;
  background-size: calc(100% - 1.47rem) 1px;
}

.cta-loco__channel:hover,
.cta-loco__channel:focus-visible {
  color: #fff;
}

.cta-loco__channel--phone {
  font-weight: 600;
}

.cta-loco__channel-icon {
  display: block;
  width: 1.1rem;
  height: 1.1rem;
  flex: 0 0 1.1rem;
  fill: currentColor;
}

@media (max-width: 900px) {
  .cta-loco {
    padding: 3rem 0 3.6rem;
  }

  .cta-loco__shell {
    min-height: 0;
    /*
     * Desktop chamfer mask eats the right column on a narrow wagon.
     * KC Legal keeps ~10px radius on mobile — no locomotive nose at phone width.
     */
    -webkit-mask-image: none;
    mask-image: none;
    border-radius: 14px;
    overflow: hidden;
  }

  .cta-loco__body {
    grid-template-columns: 1fr;
    align-items: start;
    padding: 1.35rem 1.15rem 1.25rem;
    gap: 1.15rem;
  }

  .cta-loco__copy,
  .cta-loco__actions {
    min-height: 0;
  }

  .cta-loco__copy-top {
    margin-left: 0;
  }

  .cta-loco__title {
    max-width: none;
  }

  .cta-loco__actions {
    padding-top: 0.15rem;
    padding-right: 0;
  }

  .cta-loco__cta-row {
    margin-top: 0;
  }

  article.page-service-ooo .cta-loco__cta-row {
    margin-right: 0;
  }

  .cta-loco__channels {
    gap: 0.45rem 0.85rem;
  }
}

@media (max-width: 639px) {
  .cta-loco {
    margin-top: 0.85rem;
    padding: 1.35rem 0 0.85rem;
  }

  /* Owl overlays the corner; keep the last CTA tap target clear. */
  .cta-loco__cta-row {
    max-width: calc(100% - 5.5rem);
  }
}

@media (max-width: 480px) {
  .cta-loco__pill {
    width: 100%;
    justify-content: space-between;
  }

  .cta-loco__cta-row {
    width: 100%;
  }
}

/*
 * Service/hub articles paint h2/p/a in page ink. Locomotive sits inside
 * those articles — lock light type on the dark wagon.
 */
:is(
  article.page-service-ip,
  article.page-service-ooo,
  article.page-service-tax,
  article.page-services-hub
) .cta-loco h2,
.cta-loco .cta-loco__title,
.cta-loco .cta-loco__title-lead {
  color: #fff;
}

:is(
  article.page-service-ip,
  article.page-service-ooo,
  article.page-service-tax,
  article.page-services-hub
) .cta-loco .cta-loco__title-accent,
.cta-loco .cta-loco__title-accent {
  color: var(--cta-loco-peach);
}

:is(
  article.page-service-ip,
  article.page-service-ooo,
  article.page-service-tax,
  article.page-services-hub
) .cta-loco p,
.cta-loco .cta-loco__lead {
  margin: 0;
  color: color-mix(in srgb, var(--cta-loco-ink) 90%, #fff);
}

:is(
  article.page-service-ip,
  article.page-service-ooo,
  article.page-service-tax,
  article.page-services-hub
) .cta-loco .cta-loco__who,
.cta-loco .cta-loco__who {
  color: color-mix(in srgb, var(--cta-loco-ink) 80%, #fff);
}

:is(
  article.page-service-ip,
  article.page-service-ooo,
  article.page-service-tax,
  article.page-services-hub
) .cta-loco a.cta-loco__channel {
  color: color-mix(in srgb, var(--cta-loco-ink) 82%, #fff);
}

:is(
  article.page-service-ip,
  article.page-service-ooo,
  article.page-service-tax,
  article.page-services-hub
) .cta-loco a.cta-loco__channel:hover,
:is(
  article.page-service-ip,
  article.page-service-ooo,
  article.page-service-tax,
  article.page-services-hub
) .cta-loco a.cta-loco__channel:focus-visible {
  color: #fff;
}

:is(
  article.page-service-ip,
  article.page-service-ooo,
  article.page-service-tax,
  article.page-services-hub
) .cta-loco a.cta-loco__pill {
  color: #1a1e22;
}

/* OOO: pull the pill away from the chamfered right edge */
article.page-service-ooo .cta-loco__cta-row {
  margin-right: 30px;
}

@media (prefers-reduced-motion: reduce) {
  .cta-loco.is-in .cta-loco__shell,
  .cta-loco.is-static .cta-loco__shell,
  .cta-loco.has-entered .cta-loco__shell {
    animation: none;
    transform: none;
    opacity: 1;
  }

  .cta-loco .cta-loco__title {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .cta-loco .cta-loco__bloom-ray,
  .cta-loco .cta-loco__bloom-line {
    stroke-dashoffset: 0;
    animation: none;
  }

  .cta-loco .cta-loco__bloom-area,
  .cta-loco .cta-loco__bloom-node {
    opacity: 1;
    animation: none;
  }
}
