/* TPPA prototype v15.3: case-led service pages and naturally sized publication cards. */

:root {
  --module-gap: clamp(14px, 1.25vw, 18px);
  --card-gap: var(--module-gap);
  --compact-gap: var(--module-gap);
  --section-space: var(--module-gap);
}

/* One shared gap separates neighbouring modules, headings and cards. */
.page-hero,
.page-body-layout,
.card-grid,
.section-split,
.scope-panel,
.result-panel,
.final-cta,
.page-rail__stack,
.steps-grid,
.process-carousel__track {
  gap: var(--module-gap);
}

.page-hero {
  padding-bottom: 0;
}

/* With Telegram removed from the header, the menu owns the true right edge. */
@media (min-width: 1024px) {
  body[class] .site-header__inner {
    grid-template-columns: calc(var(--logo-h) * 4) minmax(0, 1fr) 54px;
  }

  body[class] .site-header__inner .brand {
    grid-column: 1;
  }

  body[class] .site-header__inner .header-contacts {
    grid-column: 2;
  }

  body[class] .site-header__inner .menu-toggle {
    grid-column: 3;
    justify-self: end;
  }

  /* Copy and banner form the left column; the counter spans both rows so the
     lower edges of the two coloured surfaces remain exactly aligned. */
  .page-hero.page-hero--aside-service_age {
    grid-template-columns: minmax(0, 1fr) var(--rail-width);
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas:
      "copy counter"
      "banner counter";
    align-items: stretch;
  }

  .page-hero--aside-service_age .page-hero__copy {
    grid-area: copy;
  }

  .page-hero--aside-service_age .service-age,
  .page-hero--aside-service_age .service-age.page-rail__panel {
    grid-area: counter;
  }

  .page-hero--aside-service_age .feature-banner--hero {
    grid-area: banner;
    height: 100%;
    margin-top: 0;
  }
}

.page-toc {
  margin-top: var(--module-gap);
}

.feature-banner {
  margin-top: var(--module-gap);
}

.page-body-layout {
  padding-top: var(--module-gap);
}

.page-section,
.article-section {
  padding-top: var(--module-gap);
}

/* The body wrapper already supplies the first inter-module gap. Empty relocation
   slots must not make the first visible section look two gaps away. */
.page-body-main > .page-section:first-child,
.page-body-main > .mobile-rail-slot--early:empty + .page-section,
.page-body-main > .article-content:first-child > .article-section:first-child {
  padding-top: 0;
}

.section-heading,
.process-carousel-section .section-heading,
.service-process-section .section-heading,
.service-result-section > .section-heading {
  margin-bottom: var(--module-gap);
}

/* These panels already use grid gap between their heading and their content. */
.section-split > .section-heading,
.scope-panel > .section-heading,
.result-panel > .section-heading,
.service-result-section > .section-heading {
  margin-bottom: 0;
}

.final-cta {
  margin-top: var(--module-gap);
}

/* The mark and both supporting lines form one compact, legible logo lock-up. */
.brand-logo__copy {
  left: calc(var(--logo-h) * .9);
}

.brand-logo__motto {
  top: calc(var(--logo-h) * .14 - 2px);
  height: calc(var(--logo-h) * .17);
  font-size: clamp(9.5px, calc(var(--logo-h) * .155), 13px);
  letter-spacing: .008em;
}

.brand-logo__name {
  top: calc(var(--logo-h) * .31);
  font-size: calc(var(--logo-h) * .44);
  letter-spacing: -.058em;
}

.brand-logo__caption,
.site-header__inner .brand-logo__caption {
  top: calc(var(--logo-h) * .74 + 2px);
  font-size: clamp(11px, calc(var(--logo-h) * .165), 14px);
  letter-spacing: .004em;
}

/* Company counter: title, large years, four live units, statement and proof. */
.page-hero--aside-service_age .service-age,
.page-hero--aside-service_age .service-age.page-rail__panel {
  --age-digit-w: clamp(19px, 1.62vw, 23px);
  --age-digit-h: calc(var(--age-digit-w) * 1.62);
  --age-digit-gap: 3px;
  --age-digit-font: calc(var(--age-digit-w) * 1.18);
  grid-template-columns: minmax(0, 1fr);
  gap: var(--module-gap);
  min-height: 0;
  height: 100%;
  padding: clamp(54px, 4.2vw, 64px) clamp(20px, 2vw, 28px) clamp(78px, 6vw, 90px);
  align-content: center;
  container-type: inline-size;
}

.page-hero--aside-service_age .service-age::after {
  top: 42px;
  width: min(410px, 103%);
  height: min(410px, 103%);
  opacity: .6;
}

.service-age__overline {
  position: absolute;
  z-index: 2;
  top: clamp(18px, 1.8vw, 24px);
  right: clamp(18px, 1.8vw, 24px);
  left: auto;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .16em;
  line-height: 1.25;
  text-align: right;
  text-transform: uppercase;
}

.service-age__years {
  --age-digit-w: clamp(42px, 3.55vw, 52px);
  --age-digit-h: calc(var(--age-digit-w) * 1.48);
  --age-digit-gap: 5px;
  --age-digit-font: calc(var(--age-digit-w) * 1.08);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 7px;
  width: max-content;
  max-width: 100%;
  margin-inline: auto;
  padding: 0;
  justify-items: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.service-age__years .service-age__digits,
.service-age__years-label {
  grid-column: 1;
  justify-self: center;
}

.service-age__years .service-age__digits {
  grid-row: 1;
}

.service-age__years-label {
  grid-row: 2;
  padding: 0;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: clamp(27px, 2.3vw, 34px);
  font-weight: 900;
  letter-spacing: .02em;
  line-height: 1;
  text-align: center;
  text-transform: lowercase;
}

.service-age__units {
  grid-template-columns: repeat(4, max-content);
  gap: clamp(8px, 1vw, 14px);
  width: max-content;
  max-width: 100%;
  margin-inline: auto;
  justify-content: center;
  justify-self: center;
}

.service-age__unit {
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  justify-items: center;
  text-align: center;
}

.service-age__unit .service-age__digits,
.service-age__unit small {
  grid-column: 1;
  justify-self: center;
  text-align: center;
}

.service-age__unit .service-age__digits {
  grid-row: 1;
}

.service-age__unit small {
  grid-row: 2;
  color: var(--ink);
  font-size: clamp(11px, .9vw, 12.5px);
  font-weight: 800;
}

.service-age__caption,
.page-home .service-age__caption {
  --age-statement: color-mix(in srgb, var(--accent) 64%, #008f7c);
  box-sizing: border-box;
  width: 100%;
  margin: 0;
  padding: 10px 8px;
  overflow: visible;
  border: 2px solid color-mix(in srgb, var(--age-statement) 74%, #fff);
  background: rgba(255, 255, 255, .94);
  color: var(--age-statement);
  font-family: "Arial Narrow", "Roboto Condensed", var(--font-sans);
  font-size: clamp(11px, 1.05vw, 15.5px);
  font-size: clamp(12px, 5.35cqi, 17px);
  font-weight: 950;
  letter-spacing: .005em;
  line-height: 1.05;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: 0 8px 22px color-mix(in srgb, var(--age-statement) 16%, transparent);
}

.service-age__caption-text {
  width: 100%;
  max-width: 100%;
  transform: none;
}

.service-age__proof {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 3px;
  padding: 0;
  color: #3f403c;
  font-size: clamp(13px, 1vw, 15px);
  font-weight: 750;
  line-height: 1.22;
  text-align: center;
}

.service-age__proof strong,
.service-age__proof span {
  color: #3f403c;
}

.service-age__proof strong {
  font-weight: 900;
}

.service-age__details,
.service-age .button--rail,
.service-age__link {
  min-height: 46px;
  padding: 10px 14px;
}

.page-hero--aside-service_age .service-age__details,
.page-hero--aside-service_age .service-age .button--rail {
  position: absolute;
  z-index: 2;
  right: clamp(18px, 1.8vw, 24px);
  bottom: clamp(18px, 1.8vw, 24px);
  width: max-content;
  max-width: calc(100% - 36px);
  min-height: 42px;
  margin: 0;
  padding: 9px 12px;
  font-size: 13px;
  white-space: nowrap;
}

/* The upper banner is a seven-card service rotator without CTA/topic buttons. */
.feature-banner {
  display: block;
  min-height: 0;
  padding: clamp(26px, 3vw, 42px);
}

.feature-banner__content {
  display: block;
  min-height: 0;
}

.feature-banner__deck {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 190px;
  padding-right: 54px;
  align-items: center;
}

.feature-banner__message {
  position: relative;
  z-index: 1;
  display: flex;
  grid-area: 1 / 1;
  gap: 0;
  min-width: 0;
  min-height: 150px;
  margin: 0;
  padding: clamp(18px, 2vw, 28px);
  justify-content: center;
  flex-direction: column;
  visibility: hidden;
  border: 1px solid rgba(255, 255, 255, .3);
  background: rgba(255, 255, 255, .055);
  color: #fff;
  opacity: 0;
  pointer-events: none;
}

.feature-banner__message.is-active {
  z-index: 2;
  visibility: visible;
  opacity: 1;
}

.feature-banner__message .section-kicker {
  margin: 0 0 10px;
  color: var(--cta-gold);
}

.feature-banner__title {
  display: block;
  max-width: 980px;
  margin: 0;
  color: #fff;
  font-family: var(--font-serif);
  font-size: clamp(31px, 3vw, 47px);
  font-weight: 620;
  letter-spacing: .002em;
  line-height: 1.06;
  overflow-wrap: anywhere;
}

.feature-banner__reason {
  display: block;
  max-width: 920px;
  min-height: 0;
  margin-top: var(--module-gap);
  color: rgba(255, 255, 255, .9);
  font-size: clamp(17px, 1.35vw, 21px);
  font-weight: 560;
  line-height: 1.38;
  overflow-wrap: anywhere;
}

.feature-banner__progress {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
  width: 100%;
  margin-top: var(--module-gap);
}

.feature-banner__progress span {
  height: 4px;
  background: rgba(255, 255, 255, .27);
  transition: background-color 180ms ease, transform 180ms ease;
}

.feature-banner__progress span.is-active {
  background: var(--cta-gold);
  transform: scaleY(1.55);
}

.feature-banner button.feature-banner__pause {
  top: 0;
  right: 0;
}

.feature-banner__cta-row {
  position: relative;
  z-index: 4;
  display: flex;
  margin-top: var(--module-gap);
  justify-content: center;
}

.feature-banner__cta {
  display: inline-flex;
  min-height: 48px;
  padding: 12px clamp(20px, 2.4vw, 34px);
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, .82);
  background: var(--cta-gold);
  color: #18201d;
  font-size: clamp(16px, 1.22vw, 19px);
  font-weight: 900;
  line-height: 1.1;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 11px 25px rgba(15, 22, 20, .28);
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.feature-banner__cta svg {
  width: 19px;
  height: 19px;
}

.feature-banner__cta:hover,
.feature-banner__cta:focus-visible {
  filter: brightness(1.08) saturate(1.08);
  transform: translateY(-2px);
  box-shadow: 0 15px 30px rgba(15, 22, 20, .34);
}

@media (min-width: 1024px) {
  .feature-banner--hero {
    display: flex;
    min-width: 0;
    padding: clamp(20px, 2vw, 28px);
    align-items: stretch;
  }

  .feature-banner--hero .feature-banner__content {
    display: flex;
    width: 100%;
    min-width: 0;
    flex-direction: column;
    justify-content: center;
  }

  .feature-banner--hero .feature-banner__deck {
    min-height: 164px;
    padding-right: 48px;
  }

  .feature-banner--hero .feature-banner__message {
    min-height: 128px;
    padding: clamp(16px, 1.6vw, 22px);
  }

  .feature-banner--hero .feature-banner__title {
    font-size: clamp(27px, 2.35vw, 38px);
  }

  .feature-banner--hero .feature-banner__reason {
    margin-top: 10px;
    font-size: clamp(16px, 1.18vw, 19px);
    line-height: 1.32;
  }
}

/* Industry identity: icon stays primary, a unique image sits quietly underneath. */
.card-grid--industries .content-card--with-background {
  isolation: isolate;
  overflow: hidden;
  background: #fff;
}

.content-card__background {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: .11;
  filter: grayscale(.22) saturate(.72) contrast(.92);
  pointer-events: none;
  transition: opacity 180ms ease, filter 180ms ease, transform 240ms ease;
}

.card-grid--industries .content-card--with-background::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  background: linear-gradient(112deg, rgba(255, 255, 255, .92) 0 31%, rgba(255, 255, 255, .66) 70%, rgba(255, 255, 255, .55));
  pointer-events: none;
}

.content-card--with-background > :not(.content-card__background) {
  position: relative;
  z-index: 2;
}

.content-card--with-background > a::after {
  z-index: 3;
}

.card-grid--industries .content-card--with-background:hover .content-card__background,
.card-grid--industries .content-card--with-background:focus-within .content-card__background {
  opacity: .17;
  filter: grayscale(.08) saturate(.88) contrast(.94);
  transform: scale(1.025);
}

/* Publication metadata spans the whole card: date left, details right. */
.publication-card__article {
  height: auto;
  grid-template-rows: auto auto auto auto;
  gap: var(--module-gap);
}

.page-rail__publications,
.page-rail__publications ol,
.page-home .page-rail__publications ol {
  flex: none;
}

.page-rail__publications ol,
.page-home .page-rail__publications ol {
  grid-auto-rows: max-content;
  align-content: start;
}

.page-rail__publications li.publication-card,
.page-home .page-rail__publications li.publication-card {
  height: auto;
  min-height: 0;
}

.page-rail__publications .publication-card__media-row {
  gap: var(--module-gap);
}

.page-rail__publications .publication-card__summary {
  min-height: 0;
}

.publication-card__meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--module-gap);
  width: 100%;
  margin-top: 0;
  align-items: end;
}

.publication-card__date {
  grid-column: 1;
  justify-self: start;
  align-self: end;
  color: var(--ink-soft);
}

.publication-card__details {
  grid-column: 2;
  margin: 0;
  justify-self: end;
  align-self: end;
}

/* Case evidence belongs to the main editorial column. Six cards form three
   compact rows on desktop and retain the shared one-column mobile rhythm. */
.card-grid--cases .content-card--case {
  min-width: 0;
  min-height: 220px;
  padding: clamp(18px, 1.7vw, 24px);
  border-color: color-mix(in srgb, var(--card-accent) 66%, #fff);
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--card-accent) 9%, #fff), #fff 64%);
}

.card-grid--cases .content-card__icon {
  width: 48px;
  height: 48px;
}

.card-grid--cases .content-card__icon svg {
  width: 26px;
  height: 26px;
}

.card-grid--cases .content-card__label {
  color: var(--card-accent);
}

.card-grid--cases .content-card--case:hover,
.card-grid--cases .content-card--case:focus-within {
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--card-accent) 15%, #fff), #fff 70%);
}

/* At the first two-column breakpoint the counter rail is deliberately narrow.
   Keep its emphatic statement on one line without clipping. */
@media (min-width: 1024px) and (max-width: 1199.98px) {
  .service-age__caption,
  .page-home .service-age__caption {
    font-size: clamp(12px, 4.5cqi, 17px);
  }
}

@media (min-width: 761px) and (max-width: 1023.98px) {
  .page-hero.page-hero--aside-service_age {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    grid-template-areas:
      "copy"
      "counter"
      "banner";
    gap: var(--module-gap);
    align-items: start;
  }

  .page-hero--aside-service_age .page-hero__copy {
    grid-area: copy;
    grid-column: 1;
    grid-row: 1;
    width: 100%;
  }

  .page-hero--aside-service_age .service-age,
  .page-hero--aside-service_age .service-age.page-rail__panel {
    --age-digit-w: clamp(21px, 2.6vw, 27px);
    grid-area: counter;
    grid-column: 1;
    grid-row: 2;
    gap: var(--module-gap);
    width: 100%;
    height: auto;
    padding: 54px 18px 78px;
    align-self: auto;
  }

  .service-age__years {
    --age-digit-w: clamp(48px, 6vw, 58px);
  }

  .service-age__units {
    grid-template-columns: repeat(4, max-content);
    gap: clamp(9px, 1.3vw, 14px);
  }

  .page-hero--aside-service_age .feature-banner--hero {
    grid-area: banner;
    grid-column: 1;
    grid-row: 3;
    width: 100%;
    margin-top: 0;
  }

  .service-age__caption,
  .page-home .service-age__caption {
    font-size: clamp(15px, 2.1vw, 17px);
  }

  .service-age__proof {
    font-size: clamp(13px, 1.7vw, 15px);
  }

  body[class] .card-grid,
  body[class] .card-grid--industries,
  body[class] .card-grid--publications,
  body[class] .card-grid--scope,
  body[class] .card-grid--situations,
  body[class] .card-grid--situations-page,
  body[class] .card-grid--cases,
  body[class] .steps-grid,
  body[class] .page-rail__publications ol,
  body.page-home .page-rail__publications ol {
    grid-template-columns: minmax(0, 1fr);
  }

  .page-body-main > .mobile-rail-slot--early:not(:empty) {
    margin-top: 0;
  }
}

@media (max-width: 760px) {
  :root {
    --module-gap: 14px;
    --card-gap: var(--module-gap);
    --compact-gap: var(--module-gap);
    --section-space: var(--module-gap);
  }

  .site-header__inner {
    grid-template-rows: var(--logo-h) 38px;
    gap: 2px 8px;
    min-height: calc(var(--logo-h) + 40px);
    padding: 5px 0;
  }

  .site-header__inner .header-contacts {
    width: calc(var(--logo-h) * 4);
    max-width: 100%;
    min-height: 38px;
    margin: 0;
    padding: 0;
    justify-content: flex-end;
  }

  .site-header__inner .header-contact--phone {
    min-height: 38px;
  }

  .brand-logo__copy {
    left: calc(var(--logo-h) * .9);
  }

  .brand-logo__motto {
    top: calc(var(--logo-h) * .14 - 2px);
    height: calc(var(--logo-h) * .17);
    font-size: clamp(9px, calc(var(--logo-h) * .155), 11.5px);
  }

  .brand-logo__name {
    font-size: calc(var(--logo-h) * .43);
  }

  .brand-logo__caption,
  .site-header__inner .brand-logo__caption {
    top: calc(var(--logo-h) * .74 + 2px);
    font-size: clamp(10.8px, calc(var(--logo-h) * .165), 13px);
  }

  .page-hero.page-hero--aside-service_age {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    grid-template-areas:
      "copy"
      "counter"
      "banner";
    gap: var(--module-gap);
    align-items: start;
  }

  .page-body-main > .mobile-rail-slot--early:not(:empty) {
    margin-top: 0;
  }

  .page-hero--aside-service_age .page-hero__copy {
    display: block;
    grid-area: copy;
    grid-column: 1;
    grid-row: 1;
    width: 100%;
    padding-block: 8px 0;
  }

  .page-hero--aside-service_age .page-hero__eyebrow,
  .page-hero--aside-service_age h1,
  .page-hero--aside-service_age h2,
  .page-hero--aside-service_age .page-hero__lead {
    display: block;
    grid-column: auto;
    grid-row: auto;
    width: auto;
    max-width: 100%;
  }

  .page-hero--aside-service_age .service-age,
  .page-hero--aside-service_age .service-age.page-rail__panel {
    --age-digit-w: clamp(18px, 5.2vw, 22px);
    grid-area: counter;
    grid-column: 1;
    grid-row: 2;
    gap: var(--module-gap);
    width: 100%;
    height: auto;
    padding: 52px 14px 76px;
    align-self: auto;
  }

  .service-age__years {
    --age-digit-w: clamp(42px, 13vw, 50px);
  }

  .service-age__units {
    grid-template-columns: repeat(4, max-content);
    gap: 5px;
  }

  .service-age__unit {
    grid-template-columns: minmax(0, 1fr);
    gap: 5px;
  }

  .service-age__unit small {
    font-size: clamp(10.5px, 2.9vw, 11.5px);
  }

  .service-age__caption,
  .page-home .service-age__caption {
    font-size: clamp(12.5px, 3.55vw, 15.5px);
    text-align: center;
    white-space: nowrap;
  }

  .service-age__proof {
    font-size: clamp(12.5px, 3.6vw, 14px);
    text-align: center;
  }

  .service-age__overline {
    top: 16px;
    right: 14px;
  }

  .page-hero--aside-service_age .service-age__details,
  .page-hero--aside-service_age .service-age .button--rail {
    right: 14px;
    bottom: 16px;
  }

  .feature-banner {
    padding: 18px;
  }

  .page-hero--aside-service_age .feature-banner--hero {
    grid-area: banner;
    grid-column: 1;
    grid-row: 3;
    width: 100%;
    margin-top: 0;
  }

  .feature-banner__deck {
    min-height: 254px;
    padding: 42px 0 0;
  }

  .feature-banner__message {
    min-height: 212px;
    padding: 18px;
  }

  .feature-banner__title {
    font-size: clamp(26px, 7.6vw, 34px);
    line-height: 1.08;
  }

  .feature-banner__reason {
    font-size: 16px;
    line-height: 1.38;
  }

  .publication-card__meta {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }

  .publication-card__date {
    font-size: 11px;
    letter-spacing: .015em;
  }

  .publication-card__details {
    font-size: 14px;
  }
}

@media (max-width: 360px) {
  .service-age__caption,
  .page-home .service-age__caption {
    font-size: 12.5px;
  }

  .feature-banner__message {
    padding: 15px;
  }

  .publication-card__meta {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .publication-card__details {
    justify-self: end;
  }
}

@media (prefers-reduced-motion: reduce) {
  .feature-banner__message,
  .feature-banner__progress span,
  .content-card__background {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }
}
