/*
  Thomas Brown Controls motion and compatibility layer.
  The original V1_00 stylesheet remains the source of truth for branding,
  typography, colour, spacing, buttons, navigation, header and footer.
*/
:root {
  --motion-ease: cubic-bezier(.22, 1, .36, 1);
  --motion-fast: 220ms;
  --motion-medium: 620ms;
}

body {
  overflow-x: hidden;
  transition: opacity 240ms ease, transform 240ms ease;
}

body.is-leaving {
  opacity: 0;
  transform: translateY(8px);
}

.centre,
.centre .lead {
  text-align: center;
  margin-inline: auto;
}

/* Retain the original header proportions while adding a restrained scroll state. */
.site-header {
  transition: box-shadow 320ms ease, background-color 320ms ease, border-color 320ms ease;
}

.site-header.is-scrolled {
  background: rgba(255, 255, 255, .985);
  border-color: rgba(0, 16, 48, .14);
  box-shadow: 0 10px 30px rgba(0, 16, 48, .08);
}

/* Keep the original control styling and add smoother interaction only. */
.button,
.text-link svg,
.service-card,
.industry-card,
.process-step,
.capability-row,
.system-node,
.technical-card,
.project-card,
.principles-grid article,
.stat-card {
  transition-duration: 320ms;
  transition-timing-function: var(--motion-ease);
}

.button svg {
  transition: transform 300ms var(--motion-ease);
}

.button:hover svg,
.text-link:hover svg {
  transform: translateX(4px);
}

.system-node:hover {
  transform: translateY(-4px);
  border-color: rgba(114, 167, 255, .55);
}

.service-card:hover,
.industry-card:hover,
.technical-card:hover,
.project-card:hover,
.principles-grid article:hover,
.stat-card:hover {
  transform: translateY(-5px);
  border-color: rgba(0, 92, 248, .28);
  box-shadow: var(--shadow-md);
}

.card-icon {
  transition: transform 320ms var(--motion-ease), background-color 320ms ease;
}

.service-card:hover .card-icon {
  transform: translateY(-3px) scale(1.04);
  background: #e5efff;
}

.process-step:hover {
  transform: translateY(-4px);
  border-color: rgba(114, 167, 255, .42);
  background: rgba(255, 255, 255, .07);
}

.capability-row:hover {
  background: #fbfcfe;
}

/* Secondary-page hero decoration, using the original TBC colour palette. */
.page-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.page-hero.full-height {
  min-height: 70vh;
  display: grid;
  place-items: center;
}

.page-hero > .container {
  position: relative;
  z-index: 2;
}

.hero-circuit {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.hero-circuit span {
  position: absolute;
  border: 1px solid rgba(114, 167, 255, .22);
  border-left: 0;
  border-bottom: 0;
}

.hero-circuit span:nth-child(1) {
  width: 280px;
  height: 180px;
  right: 5%;
  top: 16%;
  border-radius: 0 80px 0 0;
}

.hero-circuit span:nth-child(2) {
  width: 170px;
  height: 290px;
  left: 4%;
  bottom: 8%;
  border-radius: 0 0 80px 0;
  transform: rotate(180deg);
}

.hero-circuit span:nth-child(3) {
  width: 12px;
  height: 12px;
  right: calc(5% + 276px);
  top: calc(16% + 176px);
  border: 0;
  background: var(--blue);
  border-radius: 50%;
  box-shadow: 0 0 0 8px rgba(0, 92, 248, .1);
  animation: tbc-status-pulse 3s ease-in-out infinite;
}

/* Animated-version components restyled to match original V1_00 components. */
.service-detail {
  padding-block: clamp(62px, 8vw, 104px);
  border-top: 1px solid var(--light-grey);
}

.service-detail:first-of-type {
  border-top: 0;
}

.service-detail-grid {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) minmax(260px, .46fr);
  gap: clamp(26px, 4.5vw, 58px);
  align-items: start;
}

.service-number {
  color: var(--blue);
  font-size: .76rem;
  font-weight: 850;
  letter-spacing: .15em;
  padding-top: 10px;
}

.service-detail h2 {
  font-size: clamp(1.8rem, 3.4vw, 2.75rem);
}

.service-detail .lead {
  max-width: 820px;
  margin-top: 18px;
  color: var(--steel);
  font-size: 1.05rem;
}

.list-check.compact {
  margin-top: 26px;
  gap: 10px;
}

.technical-card {
  min-width: 0;
  padding: 28px;
  background: var(--white);
  border: 1px solid var(--light-grey);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.technical-card strong {
  display: block;
  margin-top: 18px;
  color: var(--navy);
  font-size: 1.15rem;
  line-height: 1.35;
}

.technical-card p {
  margin-top: 13px;
  color: var(--steel);
}

.technical-card .text-link {
  margin-top: 24px;
}

.industry-showcase {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.industry-showcase article,
.principles-grid article,
.project-card,
.stat-card {
  position: relative;
  min-width: 0;
  padding: 30px;
  background: var(--white);
  border: 1px solid var(--light-grey);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.industry-showcase article {
  min-height: 285px;
}

.industry-showcase h2,
.project-card h2 {
  margin-top: 18px;
  font-size: clamp(1.45rem, 2.5vw, 2rem);
}

.industry-showcase p,
.principles-grid p,
.project-card p {
  margin-top: 14px;
  color: var(--steel);
}

.industry-showcase .list-check {
  margin-top: 22px;
}

.principles-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.principles-grid article {
  min-height: 225px;
}

.principles-grid article > span {
  color: var(--blue);
  font-size: .72rem;
  font-weight: 850;
  letter-spacing: .14em;
}

.principles-grid h3 {
  margin-top: 22px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.stat-card {
  min-height: 165px;
}

.stat-card strong {
  display: block;
  color: var(--navy);
  font-size: clamp(2.4rem, 5vw, 4rem);
  line-height: 1;
}

.stat-card span {
  display: block;
  margin-top: 14px;
  color: var(--steel);
  font-size: .88rem;
}

.stats-grid.dark .stat-card {
  background: rgba(255, 255, 255, .045);
  border-color: rgba(255, 255, 255, .14);
  box-shadow: none;
}

.stats-grid.dark .stat-card strong {
  color: var(--white);
}

.stats-grid.dark .stat-card span {
  color: rgba(255, 255, 255, .58);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.project-card {
  min-height: 330px;
  display: flex;
  flex-direction: column;
}

.project-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: var(--steel);
  font-size: .75rem;
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 26px;
}

.project-meta span {
  padding: 6px 9px;
  color: var(--navy);
  background: var(--off-white);
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 750;
}

.contact-grid {
  display: grid;
  grid-template-columns: minmax(280px, .42fr) minmax(0, .58fr);
  gap: clamp(46px, 8vw, 92px);
  align-items: start;
}

.contact-copy h2 {
  font-size: clamp(2rem, 4.4vw, 3.5rem);
}

.contact-direct {
  display: grid;
  gap: 5px;
  margin-top: 34px;
  padding-top: 28px;
  border-top: 1px solid var(--light-grey);
}

.contact-direct strong {
  margin-top: 14px;
  color: var(--navy);
  font-size: .78rem;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.contact-direct a {
  color: var(--blue);
  font-weight: 750;
}

.contact-form {
  display: grid;
  gap: 20px;
  padding: clamp(26px, 5vw, 42px);
  background: var(--white);
  border: 1px solid var(--light-grey);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.contact-form label:not(.checkbox) {
  display: grid;
  gap: 8px;
}

.contact-form input,
.contact-form select,
.contact-form textarea {
  margin-top: 8px;
}

.checkbox {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 10px;
  align-items: start;
  color: var(--charcoal);
  font-size: .84rem;
}

.checkbox input {
  width: 18px;
  min-height: 18px;
  margin-top: 3px;
}

.checkbox a {
  color: var(--blue);
}

.hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
}

.prose {
  display: grid;
  gap: 34px;
}

.prose h2 {
  margin-bottom: 12px;
  font-size: 1.55rem;
}

.prose p,
.prose li {
  color: #4d596c;
}

.prose ul {
  display: grid;
  gap: 8px;
}

.status-mark {
  display: grid;
  width: 74px;
  height: 74px;
  place-items: center;
  margin: 0 auto 24px;
  color: var(--white);
  background: var(--blue);
  border-radius: 50%;
}

.status-mark svg {
  width: 34px;
  height: 34px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.error-code {
  color: #72a7ff;
  font-size: .82rem;
  font-weight: 850;
  letter-spacing: .2em;
  text-transform: uppercase;
}

/* Scroll and entrance animation system. Content is hidden only after JS opts in. */
.js .will-reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 680ms var(--motion-ease), transform 680ms var(--motion-ease);
  will-change: opacity, transform;
}

.js .will-reveal.from-left {
  transform: translateX(-28px);
}

.js .will-reveal.from-right {
  transform: translateX(28px);
}

.js .will-reveal.is-visible {
  opacity: 1;
  transform: none;
}

.js .hero .hero-copy-block > *,
.js .hero .hero-panel,
.js .hero .hero-proof .proof-item,
.js .page-hero > .container > * {
  opacity: 0;
  transform: translateY(24px);
}

.hero-ready .hero-copy-block > *,
.hero-ready .hero-panel,
.hero-ready .hero-proof .proof-item,
.page-hero.hero-ready > .container > * {
  animation: tbc-hero-in 760ms var(--motion-ease) forwards;
}

.hero-ready .hero-panel {
  animation-name: tbc-panel-in;
  animation-duration: 900ms;
}

.hero-ready .hero-copy-block > *:nth-child(1),
.page-hero.hero-ready > .container > *:nth-child(1) { animation-delay: 60ms; }
.hero-ready .hero-copy-block > *:nth-child(2),
.page-hero.hero-ready > .container > *:nth-child(2) { animation-delay: 140ms; }
.hero-ready .hero-copy-block > *:nth-child(3),
.page-hero.hero-ready > .container > *:nth-child(3) { animation-delay: 220ms; }
.hero-ready .hero-copy-block > *:nth-child(4) { animation-delay: 300ms; }
.hero-ready .hero-panel { animation-delay: 220ms; }
.hero-ready .hero-proof .proof-item:nth-child(1) { animation-delay: 480ms; }
.hero-ready .hero-proof .proof-item:nth-child(2) { animation-delay: 560ms; }
.hero-ready .hero-proof .proof-item:nth-child(3) { animation-delay: 640ms; }

.hero-complete .hero-copy-block > *,
.hero-complete .hero-panel,
.hero-complete .hero-proof .proof-item,
.page-hero.hero-complete > .container > * {
  opacity: 1;
  transform: none;
}

.system-status::before {
  animation: tbc-status-pulse 2.8s ease-in-out infinite;
}

.system-map::before,
.system-map::after {
  position: absolute;
  z-index: 1;
  content: "";
  pointer-events: none;
  opacity: .4;
}

.system-map::before {
  top: 50%;
  right: 20%;
  left: 20%;
  height: 1px;
  background: linear-gradient(90deg, transparent, #72a7ff, transparent);
  animation: tbc-line-flow 5s linear infinite;
}

.system-map::after {
  top: 20%;
  bottom: 20%;
  left: 50%;
  width: 1px;
  background: linear-gradient(transparent, #72a7ff, transparent);
  animation: tbc-line-flow-y 5s linear infinite;
}

@keyframes tbc-hero-in {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: none; }
}

@keyframes tbc-panel-in {
  from { opacity: 0; transform: translateY(28px) scale(.985); }
  to { opacity: 1; transform: none; }
}

@keyframes tbc-status-pulse {
  0%, 100% { opacity: .65; box-shadow: 0 0 0 5px rgba(0, 92, 248, .12); }
  50% { opacity: 1; box-shadow: 0 0 0 9px rgba(0, 92, 248, .04); }
}

@keyframes tbc-line-flow {
  0% { transform: translateX(-12%); opacity: .12; }
  50% { opacity: .55; }
  100% { transform: translateX(12%); opacity: .12; }
}

@keyframes tbc-line-flow-y {
  0% { transform: translateY(-12%); opacity: .12; }
  50% { opacity: .55; }
  100% { transform: translateY(12%); opacity: .12; }
}

@media (max-width: 1050px) {
  .service-detail-grid {
    grid-template-columns: 62px minmax(0, 1fr);
  }

  .service-detail-grid .technical-card {
    grid-column: 2;
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .service-detail-grid {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .service-detail-grid .technical-card {
    grid-column: auto;
  }

  .service-number {
    padding-top: 0;
  }

  .industry-showcase,
  .principles-grid,
  .project-grid,
  .stats-grid,
  .field-row {
    grid-template-columns: 1fr;
  }

  .project-top {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-circuit span:nth-child(1) {
    right: -120px;
  }

  .hero-circuit span:nth-child(2) {
    left: -100px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.is-leaving {
    opacity: 1;
    transform: none;
  }

  .js .will-reveal,
  .js .hero .hero-copy-block > *,
  .js .hero .hero-panel,
  .js .hero .hero-proof .proof-item,
  .js .page-hero > .container > * {
    opacity: 1 !important;
    transform: none !important;
  }

  .hero-circuit span,
  .system-status::before,
  .system-map::before,
  .system-map::after {
    animation: none !important;
  }
}
