/* CTPL responsive layout and typography polish — v27
   Keeps the near-edge canvas introduced in v26, while correcting the
   over-stretched internal layouts, excessive component height and small text. */

:root {
  --ctpl-edge-gap: clamp(16px, 1.35vw, 28px);
  --ctpl-body-text: clamp(17px, 0.18vw + 15.2px, 19px);
  --ctpl-support-text: clamp(15.5px, 0.12vw + 14px, 16.5px);
  --ctpl-section-space: clamp(68px, 5.4vw, 96px);
  --ctpl-section-heading: clamp(2.45rem, 3.35vw, 3.85rem);
}

body {
  font-size: var(--ctpl-body-text);
  line-height: 1.62;
}

.shell,
.site-header .header-inner {
  width: calc(100% - (var(--ctpl-edge-gap) * 2)) !important;
  margin-right: var(--ctpl-edge-gap) !important;
  margin-left: var(--ctpl-edge-gap) !important;
}

/* Readable type: ordinary copy is larger, while compact technical labels remain
   deliberately smaller so they do not collide with diagrams and controls. */
body p,
body li,
body label,
body input,
body textarea,
body select,
body option {
  font-size: var(--ctpl-body-text) !important;
  line-height: 1.62;
}

body .button,
body .btn,
body .action-pill,
body .filter-btn,
body .capability-link,
body .panel-detail a,
body .product-card-action,
body .service-card-action,
body .contact-email {
  font-size: clamp(16.5px, 0.16vw + 15px, 18px) !important;
}

body .eyebrow,
body .section-kicker,
body .core-kicker,
body .detail-kicker,
body .detail-label,
body .story-kicker,
body .profile-role,
body .profile-prompt,
body .card-topline,
body .product-code,
body .product-visual-label,
body .product-modal-family,
body .product-modal-code,
body .service-card-label,
body .service-group-heading > span,
body .lining-modal-kicker,
body .lining-modal-visual > span,
body .lining-modal-options > p,
body .product-enquiry-note,
body .product-enquiry-status,
body .matrix-note p,
body .team-note {
  font-size: var(--ctpl-support-text) !important;
  line-height: 1.42;
}

body .section-heading h2,
body .section-head h2,
body .intro-grid h2,
body .delivery-grid h2 {
  font-size: var(--ctpl-section-heading) !important;
  line-height: 1.06 !important;
}

body .section-intro,
body .section-head > p,
body .intro-grid > p,
body .comparison-copy,
body .consultant-summary,
body .client-summary {
  font-size: clamp(18px, 0.3vw + 15px, 21px) !important;
  line-height: 1.65;
}

body .hero-proof strong {
  font-size: clamp(16.5px, 0.15vw + 15px, 18px) !important;
}

body .hero-proof span,
body .hero-index-core span,
body .hero-index-core small,
body .hero-index-tag b,
body .hero-index-tag span,
body .panel-summary span,
body .timeline-item strong,
body .timeline-item small,
body .story-tags span,
body .service-card-tags span,
body .lining-modal-chips span,
body .product-modal-tags .tag,
body .tag-row .tag,
body .visual-readout span,
body .visual-readout strong,
body .footer-grid p,
body .footer-copy p,
body .footer-copy span,
body .footer-meta span,
body .footer-meta small {
  font-size: var(--ctpl-support-text) !important;
  line-height: 1.42;
}

/* Consistent vertical density across all substantive pages. */
body .section,
body .intro,
body .contact-main,
body .service-stage-section,
body .consultants {
  padding-top: var(--ctpl-section-space) !important;
  padding-bottom: var(--ctpl-section-space) !important;
}

body .section-heading,
body .section-head {
  gap: clamp(30px, 3.6vw, 60px) !important;
  margin-bottom: clamp(30px, 3vw, 48px) !important;
}

/* Common hero proportions on interior pages. */
@media (min-width: 1181px) {
  .products-hero,
  .contact-hero,
  .services-hero,
  .team-hero,
  .service-hero,
  body:not(.interactive-home) main > .hero {
    min-height: clamp(650px, 76vh, 760px) !important;
    padding-top: calc(var(--ctpl-header-h) + 44px) !important;
    padding-bottom: 64px !important;
  }

  .products-hero .hero-grid,
  .contact-hero .hero-grid,
  .services-hero-grid,
  .service-hero-grid,
  body:not(.interactive-home) main > .hero .hero-grid {
    gap: clamp(38px, 3.6vw, 64px) !important;
  }

  .products-hero .hero-panel,
  .contact-hero .hero-contact-panel {
    min-height: 0 !important;
  }

  .services-hero .hero-index {
    min-height: 500px !important;
  }
}

/* Product and system catalogues: compact enough to scan, large enough to read. */
.product-card,
.service-option-card {
  min-height: 300px !important;
}

.product-card h4,
.service-option-card h4 {
  font-size: clamp(1.28rem, 1.35vw, 1.55rem) !important;
  line-height: 1.28 !important;
}

.product-card p,
.service-card-summary {
  font-size: clamp(17px, 0.2vw + 15px, 18.5px) !important;
  line-height: 1.58 !important;
}

.service-group-heading {
  grid-template-columns: minmax(135px, 0.42fr) minmax(250px, 0.9fr) minmax(330px, 1.45fr) !important;
  padding: 26px 28px 23px !important;
}

.service-option-grid {
  padding: 24px 28px 28px !important;
}

/* HOME: first screen */
@media (min-width: 1181px) {
  body.interactive-home .hero {
    min-height: clamp(720px, 84vh, 820px) !important;
    padding: calc(var(--ctpl-header-h) + 28px) 0 62px !important;
  }

  body.interactive-home .hero-grid {
    grid-template-columns: minmax(0, 0.98fr) minmax(590px, 1.02fr) !important;
    gap: clamp(32px, 3vw, 52px) !important;
  }

  body.interactive-home .hero-copy {
    max-width: 720px !important;
  }

  body.interactive-home .hero-lead {
    max-width: 720px;
    margin-top: 22px;
    font-size: clamp(18px, 0.28vw + 15px, 20px) !important;
    line-height: 1.62;
  }

  body.interactive-home .hero-actions {
    margin-top: 26px;
  }

  body.interactive-home .hero-proof {
    max-width: 760px;
    margin-top: 32px;
    padding-top: 22px;
    gap: 18px;
  }

  body.interactive-home .hero-visual-wrap {
    max-width: 680px !important;
  }

  body.interactive-home .system-orbit {
    min-height: 600px !important;
  }

  body.interactive-home .system-core {
    width: 196px !important;
    height: 196px !important;
  }

  body.interactive-home .system-core strong {
    font-size: 1.28rem;
  }

  body.interactive-home .system-core small {
    width: 154px;
    font-size: 16px !important;
    line-height: 1.38 !important;
  }

  body.interactive-home .core-kicker {
    font-size: 15px !important;
  }

  body.interactive-home .orbit-node {
    width: 198px !important;
    min-width: 198px !important;
    min-height: 86px !important;
    padding: 14px 15px !important;
  }

  body.interactive-home .orbit-node strong {
    font-size: 16.5px !important;
    line-height: 1.25 !important;
  }

  body.interactive-home .node-a,
  body.interactive-home .node-b {
    top: 11% !important;
  }

  body.interactive-home .node-c,
  body.interactive-home .node-d {
    bottom: 18% !important;
  }

  body.interactive-home .visual-caption {
    bottom: 18px !important;
    width: calc(100% - 92px) !important;
    max-width: none !important;
    min-height: 52px;
    justify-content: center;
    border-radius: 16px;
    padding: 10px 16px;
  }

  body.interactive-home .visual-caption p {
    font-size: 16.5px !important;
    line-height: 1.4 !important;
    text-align: center;
  }
}

/* HOME: capability heading and cards */
body.interactive-home .capabilities {
  padding-top: clamp(70px, 5vw, 88px) !important;
  padding-bottom: clamp(72px, 5.2vw, 92px) !important;
}

body.interactive-home .section-heading {
  grid-template-columns: minmax(0, 1.12fr) minmax(420px, 0.88fr);
  align-items: center;
}

body.interactive-home .section-heading h2 {
  max-width: 980px;
}

body.interactive-home .section-intro {
  max-width: 720px;
  justify-self: end;
}

@media (min-width: 901px) {
  body.interactive-home .capability-card {
    min-height: 300px !important;
    padding: 26px 28px 26px !important;
    display: grid !important;
    grid-template-columns: 70px minmax(0, 1fr);
    grid-template-rows: auto auto 1fr auto;
    column-gap: 24px;
    align-content: start;
  }

  body.interactive-home .capability-card .card-topline {
    grid-column: 1 / -1;
  }

  body.interactive-home .capability-icon {
    grid-column: 1;
    grid-row: 2 / 4;
    width: 58px;
    height: 58px;
    margin: 26px 0 0 !important;
  }

  body.interactive-home .capability-card h3 {
    grid-column: 2;
    margin: 25px 0 10px;
    max-width: none;
    font-size: clamp(1.35rem, 1.38vw, 1.65rem);
  }

  body.interactive-home .capability-card p {
    grid-column: 2;
    max-width: none;
    margin: 0 0 16px;
    font-size: clamp(17px, 0.18vw + 15px, 18.5px) !important;
    line-height: 1.58;
  }

  body.interactive-home .capability-link {
    grid-column: 2;
    margin-top: 4px;
  }
}

/* HOME: comparison section */
body.interactive-home .comparison {
  padding-top: clamp(72px, 5vw, 90px) !important;
  padding-bottom: clamp(72px, 5vw, 90px) !important;
}

body.interactive-home .comparison-heading {
  grid-template-columns: minmax(390px, 0.76fr) minmax(520px, 1.24fr);
  gap: clamp(42px, 5vw, 86px);
  align-items: center;
  margin-bottom: clamp(34px, 3vw, 50px);
}

body.interactive-home .comparison-heading h2 {
  max-width: 620px;
  font-size: clamp(2.7rem, 3.55vw, 4rem) !important;
  line-height: 1.02;
}

body.interactive-home .comparison-copy {
  max-width: 820px;
  justify-self: end;
}

body.interactive-home .comparison-stage {
  min-height: clamp(480px, 35vw, 560px);
}

/* HOME: delivery section */
body.interactive-home .approach {
  padding-top: clamp(72px, 5vw, 90px) !important;
  padding-bottom: clamp(72px, 5vw, 90px) !important;
}

body.interactive-home .approach-grid {
  grid-template-columns: minmax(380px, 0.82fr) minmax(620px, 1.18fr);
  gap: clamp(42px, 4.2vw, 72px);
}

body.interactive-home .approach h2 {
  max-width: 680px;
  font-size: clamp(2.65rem, 3.5vw, 4rem);
}

body.interactive-home .approach-copy > p:not(.section-kicker) {
  max-width: 650px;
}

body.interactive-home .approach-note {
  margin-top: 28px;
  padding: 18px 20px;
}

body.interactive-home .delivery-tab {
  min-height: 76px;
}

body.interactive-home .delivery-tab span {
  font-size: 14px;
}

body.interactive-home .delivery-tab strong {
  font-size: 16.5px;
}

body.interactive-home .delivery-stage {
  min-height: 286px;
  padding: 36px 38px 30px;
}

body.interactive-home .delivery-panel h3 {
  max-width: 720px;
  font-size: clamp(1.65rem, 2.1vw, 2.2rem);
}

body.interactive-home .delivery-panel > p:not(.delivery-eyebrow) {
  max-width: 760px;
  font-size: 18px !important;
}

body.interactive-home .delivery-tags span {
  font-size: 15px !important;
}

body.interactive-home .delivery-hint {
  font-size: 16px;
}

/* HOME: heritage and advantages */
body.interactive-home .difference {
  padding-top: clamp(72px, 5vw, 90px) !important;
  padding-bottom: clamp(72px, 5vw, 90px) !important;
}

body.interactive-home .difference-grid {
  grid-template-columns: minmax(460px, 0.86fr) minmax(620px, 1.14fr);
  gap: clamp(34px, 3.6vw, 60px);
}

body.interactive-home .legacy-panel {
  padding: clamp(34px, 3vw, 46px);
}

body.interactive-home .legacy-year-wrap {
  margin: 0 0 22px;
  padding-bottom: 18px;
}

body.interactive-home .legacy-year {
  font-size: clamp(6.2rem, 8.2vw, 8.2rem);
}

body.interactive-home .legacy-meta,
body.interactive-home .legacy-meta strong {
  font-size: 15px;
}

body.interactive-home .legacy-signal {
  margin-top: 8px;
  font-size: 14.5px;
}

body.interactive-home .legacy-panel h2,
body.interactive-home .difference-content h2 {
  font-size: clamp(2.4rem, 3vw, 3.45rem);
  line-height: 1.06;
}

body.interactive-home .difference-content {
  padding: 4px 0 0;
}

body.interactive-home .difference-instruction {
  font-size: 16.5px;
}

body.interactive-home .difference-list {
  gap: 10px;
  margin-top: 20px;
}

body.interactive-home .difference-list .difference-item {
  grid-template-columns: minmax(210px, 0.75fr) minmax(0, 1.25fr);
  grid-template-rows: minmax(106px, auto);
  min-height: 106px;
}

body.interactive-home .difference-trigger {
  padding: 19px 18px 19px 20px;
}

body.interactive-home .difference-trigger > span:nth-child(2) {
  font-size: 17.5px;
}

body.interactive-home .difference-detail {
  padding: 17px 20px 17px 22px;
}

body.interactive-home .difference-list .difference-detail p {
  font-size: 16.5px !important;
  line-height: 1.48;
}

body.interactive-home .difference-tags span {
  font-size: 14px !important;
}

/* Contact banners and footers should finish compactly rather than creating
   another oversized screen. */
body.interactive-home .contact {
  padding-top: 64px !important;
  padding-bottom: 70px !important;
}

body.interactive-home .contact-card,
body .contact-section .contact-card,
body .contact > .contact-card {
  min-height: 0 !important;
  padding-top: clamp(38px, 3.4vw, 56px) !important;
  padding-bottom: clamp(38px, 3.4vw, 56px) !important;
}

body .site-footer {
  padding-top: 36px !important;
  padding-bottom: 30px !important;
}

/* Large tablets and small laptops */
@media (max-width: 1180px) {
  :root {
    --ctpl-edge-gap: 16px;
    --ctpl-section-space: clamp(62px, 7vw, 82px);
  }

  body.interactive-home .hero {
    min-height: 0 !important;
  }

  body.interactive-home .section-heading,
  body.interactive-home .comparison-heading,
  body.interactive-home .approach-grid,
  body.interactive-home .difference-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  body.interactive-home .section-intro,
  body.interactive-home .comparison-copy {
    max-width: 860px;
    justify-self: start;
  }

  body.interactive-home .delivery-explorer {
    max-width: none;
  }

  body.interactive-home .legacy-year {
    font-size: clamp(6rem, 15vw, 8rem);
  }
}

/* Phones */
@media (max-width: 700px) {
  :root {
    --ctpl-edge-gap: 10px;
    --ctpl-body-text: 17px;
    --ctpl-support-text: 15px;
    --ctpl-section-space: 54px;
    --ctpl-section-heading: clamp(2.15rem, 10vw, 2.8rem);
  }

  body .section-heading,
  body .section-head,
  body .intro-grid,
  body .delivery-grid {
    grid-template-columns: 1fr !important;
    gap: 18px !important;
  }

  .product-card,
  .service-option-card {
    min-height: 0 !important;
    padding: 21px !important;
  }

  .service-group-heading {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    padding: 21px 20px 19px !important;
  }

  .service-option-grid {
    padding: 18px 20px 22px !important;
  }

  body.interactive-home .hero {
    padding-bottom: 52px;
  }

  body.interactive-home .hero-grid {
    gap: 34px;
  }

  body.interactive-home .hero-proof {
    gap: 12px;
  }

  body.interactive-home .system-orbit {
    min-height: 520px;
  }

  body.interactive-home .orbit-node {
    min-height: 70px !important;
    padding: 11px 10px !important;
  }

  body.interactive-home .orbit-node strong {
    font-size: 15.5px !important;
  }

  body.interactive-home .visual-caption {
    width: calc(100% - 28px) !important;
    bottom: 12px !important;
    border-radius: 14px;
  }

  body.interactive-home .visual-caption p {
    font-size: 15.5px !important;
  }

  body.interactive-home .capability-grid {
    gap: 14px;
  }

  body.interactive-home .capability-card {
    min-height: 0 !important;
    padding: 22px !important;
  }

  body.interactive-home .capability-icon {
    margin: 22px 0 18px;
  }

  body.interactive-home .comparison-stage {
    min-height: 390px;
  }

  body.interactive-home .delivery-stage {
    min-height: 0;
    padding: 31px 21px 24px;
  }

  body.interactive-home .delivery-panel > p:not(.delivery-eyebrow) {
    font-size: 17px !important;
  }

  body.interactive-home .legacy-panel {
    padding: 26px 22px;
  }

  body.interactive-home .legacy-year-wrap {
    margin-bottom: 18px;
    padding-bottom: 16px;
  }

  body.interactive-home .legacy-year {
    font-size: clamp(5rem, 26vw, 7rem);
  }

  body.interactive-home .legacy-meta,
  body.interactive-home .legacy-meta strong {
    font-size: 13.5px;
  }

  body.interactive-home .legacy-signal {
    font-size: 12.5px;
    gap: 8px;
  }

  body.interactive-home .difference-content {
    padding: 0;
  }

  body.interactive-home .difference-list {
    gap: 12px;
  }

  body.interactive-home .difference-list .difference-item {
    display: block;
    min-height: 84px !important;
    border-radius: 16px;
  }

  body.interactive-home .difference-trigger {
    min-height: 84px;
    padding: 18px 16px;
    border: 0;
  }

  body.interactive-home .difference-trigger > span:nth-child(2) {
    font-size: 17px;
    line-height: 1.3;
  }

  body.interactive-home .difference-detail {
    display: none;
  }

  body.interactive-home .contact-card {
    padding-right: 24px !important;
    padding-left: 24px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}
