/* Final layout rhythm layer: keep section spacing and dense content consistent. */

:root {
  --txf-rhythm-section-y: clamp(88px, 7vw, 104px);
  --txf-rhythm-head-gap: clamp(38px, 3.35vw, 48px);
  --txf-rhythm-panel-pad: clamp(30px, 3vw, 42px);
  --txf-rhythm-card-pad: clamp(26px, 2.45vw, 34px);
}

/* Page-level section cadence */
.page-home :is(#services, #usecases, #fit, #process, #trust, #contact),
.page-service :is(#packages, #process, #contact),
.page-service .service-rules-section {
  padding-block: var(--txf-rhythm-section-y) !important;
}

.page-home #fit.fit,
.page-home #process.handoff-section,
.page-home #trust.cooperation-guide-section,
.page-home #contact.contact-flow-section,
.page-service #contact.service-contact-close {
  padding-block: var(--txf-rhythm-section-y) !important;
}

.page-home :is(#services, #usecases, #fit, #process, #trust) .section-head,
.page-service :is(#packages, #process) .section-head,
.page-service .service-rules-section .section-head {
  margin-bottom: var(--txf-rhythm-head-gap) !important;
}

.page-service #contact.service-contact-close {
  margin-top: 0 !important;
}

/* Homepage: reduce stacked spacing without flattening the editorial hierarchy. */
.page-home #services .service-entry-cta {
  margin: 0 0 20px !important;
}

.page-home #services .home-service-bridge {
  margin-bottom: 32px !important;
}

.page-home #services .service-grid .service-card {
  min-height: 414px !important;
  padding: var(--txf-rhythm-card-pad) !important;
}

.page-home #services .service-card-meta {
  margin-bottom: 18px !important;
  padding-bottom: 12px !important;
}

.page-home #services .service-grid .service-card p {
  margin-top: 14px !important;
}

.page-home #services .service-points {
  margin-top: 18px !important;
}

.page-home #usecases .usecase-card,
.page-home #usecases .usecase-card:first-child,
.page-home #usecases .usecase-card:not(:first-child) {
  padding: var(--txf-rhythm-panel-pad) !important;
}

.page-home #usecases .usecase-flow {
  margin-top: 20px !important;
}

.page-home #usecases .deliverables,
.page-home #usecases .usecase-route,
.page-home #usecases .usecase-action {
  margin-top: 22px !important;
}

.page-home #fit .fit-primary {
  padding: var(--txf-rhythm-panel-pad) !important;
}

.page-home #fit .fit-brief {
  padding: var(--txf-rhythm-card-pad) !important;
}

.page-home #process .handoff-primer {
  padding: var(--txf-rhythm-panel-pad) !important;
}

.page-home #process .handoff-primer strong {
  margin-top: 36px !important;
}

.page-home #process .handoff-primer .section-cta {
  padding-top: 24px !important;
}

.page-home #process .handoff-step {
  padding: var(--txf-rhythm-card-pad) !important;
}

.page-home #process .handoff-step h3 {
  margin-top: 32px !important;
}

.page-home #process .handoff-step p {
  margin-top: 14px !important;
}

.page-home #trust .guide-manual {
  padding: var(--txf-rhythm-panel-pad) !important;
}

.page-home #trust .guide-manual strong {
  margin-top: 40px !important;
}

.page-home #trust .guide-check,
.page-home #trust .guide-check:nth-child(2n) {
  padding: var(--txf-rhythm-card-pad) !important;
}

.page-home #contact .contact-copy,
.page-home #contact .contact-form-panel {
  min-height: 560px !important;
  padding: clamp(38px, 3.65vw, 50px) !important;
}

.page-home #contact .contact-copy h2 {
  margin-top: 26px !important;
}

.page-home #contact .contact-lead {
  margin-top: 20px !important;
}

.page-home #contact .contact-outcomes {
  padding-top: 34px !important;
}

/* Service page: bring long sections back to the same cadence as the homepage. */
.page-service #packages .package-grid .service-card {
  padding: var(--txf-rhythm-panel-pad) !important;
}

.page-service #packages .package-head {
  padding-bottom: 18px !important;
}

.page-service #packages .package-card > h3 {
  margin-top: 28px !important;
}

.page-service #packages .package-summary {
  margin-top: 14px !important;
}

.page-service #packages .service-meta {
  padding-top: 26px !important;
}

.page-service .handoff-roadmap .process-step {
  min-height: 308px !important;
  padding: var(--txf-rhythm-card-pad) !important;
}

.page-service .handoff-roadmap .step-num {
  margin-bottom: 24px !important;
}

.page-service .handoff-roadmap .process-step h3 {
  margin: 12px 0 14px !important;
}

.page-service .handoff-roadmap .process-step small {
  padding-top: 18px !important;
}

.page-service .handoff-inventory {
  padding: var(--txf-rhythm-panel-pad) !important;
}

.page-service .handoff-inventory > strong {
  margin-top: 34px !important;
}

.page-service .handoff-inventory ul {
  padding-top: 24px !important;
}

.page-service .handoff-standard .acceptance-row,
.page-service .handoff-standard .acceptance-row:nth-child(2n),
.page-service .handoff-standard .acceptance-row:nth-last-child(-n + 2) {
  min-height: 208px !important;
  padding: var(--txf-rhythm-card-pad) !important;
}

.page-service .rules-principle,
.page-service .rules-faq {
  padding: var(--txf-rhythm-panel-pad) !important;
}

.page-service .rules-principle > strong {
  margin-top: 28px !important;
}

.page-service .rules-list li {
  min-height: 132px;
  padding: 22px var(--txf-rhythm-card-pad);
}

.page-service .rules-faq > .rules-column-label {
  margin-bottom: 24px;
}

.page-service .rules-faq summary {
  padding-block: 20px;
}

.page-service .rules-faq summary::after {
  top: 20px;
}

.page-service .rules-faq details p {
  padding-bottom: 20px;
}

.page-service #contact .contact-copy,
.page-service #contact .contact-form-panel {
  min-height: 560px !important;
  padding: clamp(38px, 3.65vw, 50px) !important;
}

.page-service #contact .contact-copy h2 {
  margin-top: 26px !important;
}

@media (max-width: 960px) {
  :root {
    --txf-rhythm-section-y: 64px;
    --txf-rhythm-head-gap: 38px;
    --txf-rhythm-panel-pad: 28px;
    --txf-rhythm-card-pad: 24px;
  }

  .page-home #services .service-grid .service-card {
    min-height: auto !important;
  }

  .page-home #process .handoff-primer strong,
  .page-home #trust .guide-manual strong {
    margin-top: 28px !important;
  }

  .page-home #contact .contact-copy,
  .page-home #contact .contact-form-panel,
  .page-service #contact .contact-copy,
  .page-service #contact .contact-form-panel {
    min-height: auto !important;
  }
}

@media (max-width: 560px) {
  :root {
    --txf-rhythm-section-y: 52px;
    --txf-rhythm-head-gap: 32px;
    --txf-rhythm-panel-pad: 24px;
    --txf-rhythm-card-pad: 22px;
  }

  .page-home #services .service-entry-cta {
    margin-bottom: 16px !important;
  }

  .page-home #services .home-service-bridge {
    margin-bottom: 24px !important;
  }

  .page-home #services .service-card-meta {
    margin-bottom: 14px !important;
  }

  .page-home #usecases .usecase-flow,
  .page-home #usecases .deliverables,
  .page-home #usecases .usecase-route,
  .page-home #usecases .usecase-action {
    margin-top: 18px !important;
  }

  .page-home #process .handoff-primer .section-cta {
    padding-top: 20px !important;
  }

  .page-home #process .handoff-step h3 {
    margin-top: 20px !important;
  }

  .page-home #trust .guide-manual {
    min-height: 286px !important;
  }

  body.page-home #trust.cooperation-guide-section .guide-check:nth-child(n) {
    min-height: 176px !important;
  }

  .page-home #trust .boundary-closeout {
    padding: 22px !important;
  }

  .page-home #contact .contact-copy,
  .page-home #contact .contact-form-panel,
  .page-service #contact .contact-copy,
  .page-service #contact .contact-form-panel {
    padding: 26px 22px !important;
  }

  .page-home #contact .contact-outcomes {
    margin-top: 30px !important;
    padding-top: 20px !important;
  }

  .page-service #packages .package-grid .service-card,
  .page-service .handoff-roadmap .process-step,
  .page-service .handoff-inventory,
  .page-service .rules-principle,
  .page-service .rules-faq {
    padding: var(--txf-rhythm-card-pad) !important;
  }

  .page-service #packages .package-card > h3 {
    margin-top: 24px !important;
  }

  .page-service #packages .service-meta {
    padding-top: 22px !important;
  }

  .page-service .handoff-roadmap .process-step {
    min-height: 248px !important;
  }

  .page-service .handoff-standard .acceptance-row,
  .page-service .handoff-standard .acceptance-row:nth-child(2n),
  .page-service .handoff-standard .acceptance-row:nth-last-child(-n + 2) {
    min-height: 158px !important;
    padding: var(--txf-rhythm-card-pad) !important;
  }

  .page-service .rules-list li {
    min-height: auto;
    padding: 20px 22px;
  }
}
