/* =========================================
   Moonlighter Group — Shared Components
   Design System v1.0 — foundation phase
   Loaded after style.css to normalise legacy rules
   ========================================= */

/* ---------- Base normalization ---------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--ds-header-height) + 24px);
}

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--ds-surface-0);
  color: var(--ds-text-900);
  font-family: var(--ds-font);
  font-size: var(--ds-fs-body);
  line-height: var(--ds-lh-body);
  -webkit-font-smoothing: antialiased;
}

body.nav-open { overflow: hidden; }

img { max-width: 100%; display: block; }
a { color: var(--ds-blue-600); text-decoration: none; }
a:hover { text-decoration: none; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--ds-font);
  color: var(--ds-text-900);
  font-weight: 650;
  line-height: var(--ds-lh-heading);
  letter-spacing: -0.02em;
  margin: 0 0 var(--ds-space-4);
}

h1 { font-size: var(--ds-fs-h1); line-height: var(--ds-lh-tight); letter-spacing: -0.03em; }
h2 { font-size: var(--ds-fs-h2); }
h3 { font-size: var(--ds-fs-h3); }
h4 { font-size: var(--ds-fs-h4); }
h5 { font-size: var(--ds-fs-h5); }
p { margin: 0 0 var(--ds-space-4); }

[id] { scroll-margin-top: calc(var(--ds-header-height) + 24px); }

:focus-visible {
  outline: 3px solid #0b1220;
  outline-offset: 2px;
  box-shadow: 0 0 0 6px #22d3ee;
  border-radius: var(--ds-radius-sm);
}

:focus:not(:focus-visible) {
  outline: none;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: var(--ds-space-4);
  z-index: 2000;
  background: var(--ds-surface-0);
  color: var(--ds-blue-600);
  padding: 12px 18px;
  border-radius: var(--ds-radius-sm);
  font-weight: 600;
  transition: top var(--ds-dur-fast) var(--ds-ease);
}
.skip-link:focus { top: var(--ds-space-4); }

.container {
  width: 100%;
  max-width: var(--ds-container);
  margin-inline: auto;
  padding-inline: var(--ds-space-6);
}

/* ---------- Header & navigation ---------- */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 1000;
  height: var(--ds-header-height);
  display: flex;
  align-items: center;
  background: var(--ds-ink-900);
  color: var(--ds-text-inv);
  box-shadow: none;
  transition: box-shadow var(--ds-dur-fast) var(--ds-ease);
}

.site-header.scrolled {
  background: var(--ds-ink-900);
  box-shadow: var(--ds-shadow-2);
}

.site-header .container {
  display: flex;
  align-items: center;
  gap: var(--ds-space-6);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--ds-space-4);
  margin-left: auto;
}

.site-logo {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

.site-logo img {
  width: auto;
  height: 32px;
  max-width: 150px;
}

.main-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-left: auto;
  gap: var(--ds-space-1);
}

.main-nav > ul {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-item { position: relative; }

.nav-item__row {
  display: flex;
  align-items: center;
}

.main-nav .nav-link {
  position: relative;
  display: block;
  padding: 8px 5px;
  color: rgba(232, 240, 248, 0.82);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  transition: color var(--ds-dur-fast) var(--ds-ease);
}

.main-nav .nav-link:hover,
.main-nav .nav-link:focus-visible { color: var(--ds-surface-0); }

.nav-item.is-active > .nav-item__row > .nav-link { color: var(--ds-surface-0); }

.nav-item.is-active > .nav-item__row > .nav-link::after {
  content: '';
  position: absolute;
  left: 5px;
  right: 5px;
  bottom: 2px;
  height: 2px;
  background: var(--ds-cyan-400);
  border-radius: var(--ds-radius-pill);
}

.dropdown-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(232, 240, 248, 0.7);
  cursor: pointer;
}

.dropdown-toggle::after {
  content: '';
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform var(--ds-dur-fast) var(--ds-ease);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 230px;
  list-style: none;
  margin: 0;
  padding: var(--ds-space-2);
  background: var(--ds-surface-0);
  border: 1px solid var(--ds-line);
  border-radius: var(--ds-radius-md);
  box-shadow: var(--ds-shadow-2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  /* Visibility must change immediately so keyboard focus and Escape are not
     blocked while the opacity/transform animation is still running. */
  transition: opacity var(--ds-dur-fast) var(--ds-ease),
              transform var(--ds-dur-fast) var(--ds-ease);
  z-index: 1001;
}

.main-nav .dropdown-menu a {
  display: block;
  padding: 10px 12px;
  border-radius: var(--ds-radius-sm);
  color: var(--ds-text-900);
  font-size: 0.875rem;
  font-weight: 500;
}

.main-nav .dropdown-menu a:hover,
.main-nav .dropdown-menu a:focus-visible {
  background: var(--ds-surface-50);
  color: var(--ds-blue-600);
}

@media (hover: hover) and (min-width: 769px) {
  .has-dropdown:hover .dropdown-menu,
  .has-dropdown:focus-within .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
  .has-dropdown:hover .dropdown-toggle::after,
  .has-dropdown.is-open .dropdown-toggle::after { transform: rotate(225deg) translateY(-1px); }
}

.has-dropdown.is-open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* The Insights dropdown is the last menu with a submenu. At mid-size desktop
   widths, left alignment would push it past the viewport edge, so align it to
   the right edge of its nav item. */
@media (min-width: 901px) {
  .nav-item[data-nav-page="blog"] .dropdown-menu {
    left: auto;
    right: 0;
  }
}

/* An explicit Escape closes the menu even while focus remains inside it. */
.has-dropdown.is-forced-closed:hover .dropdown-menu,
.has-dropdown.is-forced-closed:focus-within .dropdown-menu {
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  pointer-events: none;
}

.header-actions,
.main-nav { min-width: 0; }
.nav-cta { margin-left: var(--ds-space-3); flex: 0 0 auto; }
.nav-cta .btn { min-height: 40px; padding-inline: 12px; font-size: 0.8125rem; }
.main-nav > .mobile-quote { display: none; }

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--ds-radius-sm);
  background: transparent;
  color: var(--ds-surface-0);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  margin-left: auto;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform var(--ds-dur-fast) var(--ds-ease), opacity var(--ds-dur-fast) var(--ds-ease);
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-close {
  display: none;
  position: absolute;
  top: var(--ds-space-4);
  right: var(--ds-space-6);
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--ds-radius-sm);
  background: transparent;
  color: var(--ds-surface-0);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--ds-space-2);
  min-height: 48px;
  padding: 0 var(--ds-space-6);
  border: 1px solid transparent;
  border-radius: var(--ds-radius-sm);
  font-family: var(--ds-font);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  transition: background-color var(--ds-dur-fast) var(--ds-ease),
              border-color var(--ds-dur-fast) var(--ds-ease),
              color var(--ds-dur-fast) var(--ds-ease),
              transform var(--ds-dur-fast) var(--ds-ease),
              box-shadow var(--ds-dur-fast) var(--ds-ease);
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn--primary,
.btn.btn-primary {
  background: var(--ds-blue-600);
  border-color: var(--ds-blue-600);
  color: var(--ds-surface-0);
}
.btn--primary:hover,
.btn.btn-primary:hover { background: var(--ds-blue-700); border-color: var(--ds-blue-700); color: var(--ds-surface-0); }

.btn--secondary,
.btn.btn-outline {
  background: transparent;
  border-color: var(--ds-line);
  color: var(--ds-text-900);
}
.btn--secondary:hover,
.btn.btn-outline:hover { border-color: var(--ds-blue-600); color: var(--ds-blue-600); }

.site-header .btn--secondary,
.site-footer .btn--secondary {
  border-color: rgba(255, 255, 255, 0.35);
  color: var(--ds-surface-0);
}

.btn--ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.35);
  color: var(--ds-surface-0);
}
.btn--ghost:hover { border-color: var(--ds-cyan-400); color: var(--ds-cyan-400); }

.btn--sm { min-height: 40px; padding-inline: var(--ds-space-4); font-size: 0.875rem; }
.btn--block { width: 100%; }

.text-link {
  display: inline-flex;
  align-items: center;
  gap: var(--ds-space-2);
  color: var(--ds-blue-600);
  font-weight: 600;
  font-size: 0.9375rem;
}
.text-link::after { content: '\2192'; transition: transform var(--ds-dur-fast) var(--ds-ease); }
.text-link:hover::after { transform: translateX(4px); }

/* ---------- Breadcrumbs ---------- */

.breadcrumbs {
  background: var(--ds-surface-50);
  border-bottom: 1px solid var(--ds-line);
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--ds-space-2);
  list-style: none;
  margin: 0;
  padding: var(--ds-space-3) 0;
  font-size: 0.8125rem;
  color: var(--ds-text-600);
}

.breadcrumbs li { display: flex; align-items: center; gap: var(--ds-space-2); }
.breadcrumbs li + li::before { content: '/'; color: #9fb0c4; }
.breadcrumbs a { color: var(--ds-text-600); font-weight: 500; }
.breadcrumbs a:hover { color: var(--ds-blue-600); }
.breadcrumbs [aria-current="page"] { color: var(--ds-text-900); font-weight: 600; }

/* ---------- Page heroes ---------- */

.page-hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 360px;
  margin-top: var(--ds-header-height);
  padding: var(--ds-space-16) 0 var(--ds-space-12);
  background-color: var(--ds-ink-900);
  background-size: cover;
  background-position: center;
  color: var(--ds-text-inv);
  isolation: isolate;
}

.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgba(6, 24, 46, 0.92) 0%, rgba(6, 24, 46, 0.74) 62%, rgba(6, 24, 46, 0.58) 100%);
}

.breadcrumbs + .page-hero { margin-top: 0; }

.page-hero h1,
.page-hero h2 {
  color: var(--ds-surface-0);
  max-width: 18ch;
  margin-bottom: var(--ds-space-4);
}

.page-hero p {
  max-width: 68ch;
  color: var(--ds-text-inv-muted);
  font-size: var(--ds-fs-lead);
  line-height: var(--ds-lh-body);
  margin-bottom: 0;
}

.hero { background: var(--ds-ink-900); }
.hero-pause {
  position: absolute;
  right: var(--ds-space-6);
  bottom: 34px;
  z-index: 3;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: var(--ds-radius-sm);
  background: rgba(6, 24, 46, 0.55);
  color: var(--ds-surface-0);
  font-family: var(--ds-font);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}
.hero-pause:hover { border-color: var(--ds-cyan-400); color: var(--ds-cyan-400); }
.hero-content .badge,
.section-header .badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: var(--ds-radius-pill);
  background: rgba(34, 211, 238, 0.12);
  color: var(--ds-cyan-400);
  font-size: var(--ds-fs-eyebrow);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.section-header .badge { background: var(--ds-surface-100); color: var(--ds-cyan-600); }

/* ---------- Section rhythm ---------- */

.section { padding: var(--ds-space-24) 0; }
.section--alt { background: var(--ds-surface-50); }
.section--dark {
  background: var(--ds-ink-900);
  color: var(--ds-text-inv);
}
.section--dark h1,
.section--dark h2,
.section--dark h3,
.section--dark h4,
.section--dark h5 { color: var(--ds-surface-0); }
.section--dark p { color: var(--ds-text-inv-muted); }

.section-header { margin-bottom: var(--ds-space-12); }
.section-header p { max-width: 68ch; color: var(--ds-text-600); font-size: var(--ds-fs-lead); }
.content-block p,
.post-body p,
.terms-content p { max-width: 72ch; }

/* ---------- Cards ---------- */

.card {
  background: var(--ds-surface-0);
  border: 1px solid var(--ds-line);
  border-radius: var(--ds-radius-md);
  padding: var(--ds-space-8);
  box-shadow: var(--ds-shadow-1);
  transition: border-color var(--ds-dur-base) var(--ds-ease),
              box-shadow var(--ds-dur-base) var(--ds-ease),
              transform var(--ds-dur-base) var(--ds-ease);
}

.card:hover {
  border-color: var(--ds-blue-600);
  box-shadow: var(--ds-shadow-2);
  transform: translateY(-2px);
}

.card--feature,
.card--service,
.card--industry {
  padding: 0;
  overflow: hidden;
}

.card--feature .card-body,
.card--service .card-body,
.card--industry .card-body { padding: var(--ds-space-6); }

.card--feature .card-image,
.card--service .card-image,
.card--industry .card-image,
.card--industry .industry-card-image {
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.card--feature .bg-img,
.card--service .bg-img,
.card--industry .bg-img {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
}

.card--dark,
.section--dark .card {
  background: var(--ds-ink-800);
  border-color: rgba(255, 255, 255, 0.14);
  color: var(--ds-text-inv);
}
.card--dark h1, .card--dark h2, .card--dark h3, .card--dark h4, .card--dark h5,
.section--dark .card h1, .section--dark .card h2, .section--dark .card h3,
.section--dark .card h4, .section--dark .card h5 { color: var(--ds-surface-0); }
.card--dark p, .section--dark .card p { color: var(--ds-text-inv-muted); }

.card-badge,
.badge {
  display: inline-block;
  margin-bottom: var(--ds-space-3);
  padding: 5px 10px;
  border-radius: var(--ds-radius-pill);
  background: var(--ds-surface-100);
  color: var(--ds-cyan-600);
  font-size: var(--ds-fs-eyebrow);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.card--dark .card-badge,
.card--dark .badge,
.section--dark .card-badge,
.section--dark .badge { background: rgba(34, 211, 238, 0.12); color: var(--ds-cyan-400); }

.card h5, .card h4 { margin-bottom: var(--ds-space-2); }
.card p { margin-bottom: 0; color: var(--ds-text-600); font-size: 0.9375rem; }

/* ---------- Call to action ---------- */

.cta-panel,
.card--cta {
  position: relative;
  background: var(--ds-ink-800);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-left: 3px solid var(--ds-cyan-400);
  border-radius: var(--ds-radius-md);
  padding: var(--ds-space-8);
  color: var(--ds-text-inv);
}
.cta-panel h2, .cta-panel h3, .cta-panel h4, .cta-panel h5,
.card--cta h2, .card--cta h3, .card--cta h4, .card--cta h5 { color: var(--ds-surface-0); }
.cta-panel p, .card--cta p { color: var(--ds-text-inv-muted); }

/* ---------- Article cards ---------- */

.blog-card,
.card--article {
  background: var(--ds-surface-0);
  border: 1px solid var(--ds-line);
  border-radius: var(--ds-radius-md);
  overflow: hidden;
  box-shadow: var(--ds-shadow-1);
  transition: box-shadow var(--ds-dur-base) var(--ds-ease), border-color var(--ds-dur-base) var(--ds-ease);
}
.blog-card:hover,
.card--article:hover { box-shadow: var(--ds-shadow-2); border-color: var(--ds-blue-600); }
.blog-card-media,
.card--article .card-image { aspect-ratio: 16 / 9; }
.blog-card-body,
.card--article .card-body { padding: var(--ds-space-6); }
.blog-card-meta,
.post-meta-line { color: var(--ds-text-600); font-size: var(--ds-fs-small); }
.post-body { max-width: 760px; margin-inline: auto; }

/* ---------- Contact information & form ---------- */

.contact-info-list { list-style: none; margin: 0; padding: 0; }
.contact-info-list li {
  padding: var(--ds-space-3) 0;
  border-bottom: 1px solid var(--ds-line);
}
.contact-info-list .label {
  display: block;
  color: var(--ds-text-600);
  font-size: var(--ds-fs-small);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.contact-info-list .value { display: block; color: var(--ds-text-900); font-weight: 500; }

.contact-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--ds-space-4);
}

.form-field { margin-bottom: var(--ds-space-4); }
.form-field label {
  display: block;
  margin-bottom: var(--ds-space-2);
  color: var(--ds-text-900);
  font-size: 0.8125rem;
  font-weight: 600;
}

.form-input,
.form-textarea {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--ds-line);
  border-radius: var(--ds-radius-sm);
  background: var(--ds-surface-0);
  color: var(--ds-text-900);
  font-family: var(--ds-font);
  font-size: 1rem;
  transition: border-color var(--ds-dur-fast) var(--ds-ease), box-shadow var(--ds-dur-fast) var(--ds-ease);
}
.form-textarea { min-height: 140px; resize: vertical; }
.form-input:focus,
.form-textarea:focus { border-color: var(--ds-blue-600); box-shadow: var(--ds-focus-ring); outline: none; }

.form-consent {
  display: flex;
  align-items: flex-start;
  gap: var(--ds-space-2);
  margin: var(--ds-space-4) 0;
  color: var(--ds-text-600);
  font-size: var(--ds-fs-small);
  line-height: 1.5;
}
.form-consent input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--ds-blue-600); flex: 0 0 auto; }
.form-consent a { color: var(--ds-blue-600); text-decoration: underline; }

.form-status {
  margin-top: var(--ds-space-4);
  padding: var(--ds-space-3) var(--ds-space-4);
  border-radius: var(--ds-radius-sm);
  background: var(--ds-surface-50);
  border-left: 3px solid var(--ds-blue-600);
  font-size: var(--ds-fs-small);
}
.form-status[hidden] { display: none; }

/* ---------- Partner logos ---------- */

.clients-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--ds-space-4); }
.client-card {
  background: var(--ds-surface-0);
  border: 1px solid var(--ds-line);
  border-radius: var(--ds-radius-md);
  overflow: hidden;
  transition: border-color var(--ds-dur-base) var(--ds-ease), box-shadow var(--ds-dur-base) var(--ds-ease);
}
.client-card:hover { border-color: var(--ds-blue-600); box-shadow: var(--ds-shadow-2); }
.client-card-image {
  height: 220px;
  background-color: var(--ds-surface-0);
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}
.client-card-image.client-card-logo { background-size: 65% auto; }

/* ---------- Social links ---------- */

.social-links,
.footer-social { display: flex; gap: var(--ds-space-2); align-items: center; }
.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--ds-line);
  border-radius: var(--ds-radius-sm);
  color: var(--ds-text-600);
  background: var(--ds-surface-0);
  transition: color var(--ds-dur-fast) var(--ds-ease), border-color var(--ds-dur-fast) var(--ds-ease);
}
.site-footer .social-link { border-color: rgba(255, 255, 255, 0.24); color: var(--ds-text-inv-muted); background: transparent; }
.social-link:hover { color: var(--ds-blue-600); border-color: var(--ds-blue-600); }
.site-footer .social-link:hover { color: var(--ds-cyan-400); border-color: var(--ds-cyan-400); }

/* ---------- Footer ---------- */

.site-footer {
  background: var(--ds-ink-900);
  color: var(--ds-text-inv-muted);
  padding-top: var(--ds-space-24);
}
.site-footer h2,
.footer-heading {
  color: var(--ds-surface-0);
  font-size: var(--ds-fs-small);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: var(--ds-space-12);
  padding-bottom: var(--ds-space-16);
}
.footer-brand .site-logo img { height: 32px; width: auto; }
.footer-tagline { color: var(--ds-cyan-400); font-weight: 500; }
.footer-address h2 { margin-top: var(--ds-space-6); }
.footer-links,
.footer-contact { list-style: none; margin: 0; padding: 0; }
.footer-links li,
.footer-contact li { margin-bottom: var(--ds-space-3); }
.footer-links a,
.footer-contact a { color: var(--ds-text-inv-muted); }
.footer-links a:hover,
.footer-contact a:hover { color: var(--ds-cyan-400); }
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ds-space-4);
  padding: var(--ds-space-6) 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: var(--ds-fs-small);
}
.footer-legal { display: flex; gap: var(--ds-space-6); list-style: none; margin: 0; padding: 0; }
.footer-legal a { color: var(--ds-text-inv-muted); }
.footer-legal a:hover { color: var(--ds-cyan-400); }
.copyright { margin: 0; }

/* ---------- Legal documents ---------- */

.terms-table-wrapper { overflow-x: auto; }
.terms-table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.terms-table th,
.terms-table td { padding: 12px 14px; border: 1px solid var(--ds-line); text-align: left; vertical-align: top; }
.terms-table th { background: var(--ds-surface-100); color: var(--ds-text-900); font-weight: 600; }
.terms-content,
.legal-content { max-width: 760px; margin-inline: auto; }
.terms-content p,
.legal-content p { font-size: 1rem; line-height: var(--ds-lh-legal); }

/* ---------- Responsive ---------- */

@media (max-width: 1024px) {
  .grid-4, .clients-grid { grid-template-columns: repeat(2, 1fr); }
  .content-sidebar, .contact-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .main-nav .nav-link { padding: 8px 5px; font-size: 0.75rem; }
  .header-actions .nav-cta { display: none; }
}

/* Collapsed navigation starts before the tablet range so the longer
   "Customised Solutions" label never overlaps the logo. */
@media (max-width: 900px) {
  :root { --ds-header-height: var(--ds-header-height-mobile); }

  .nav-toggle { display: inline-flex; }
  .header-actions .nav-cta { display: none; }

  .main-nav {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    margin: 0;
    padding: calc(var(--ds-header-height-mobile) + var(--ds-space-8)) var(--ds-space-6) var(--ds-space-8);
    background: var(--ds-ink-900);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    overflow-y: auto;
    transition: opacity var(--ds-dur-base) var(--ds-ease),
                transform var(--ds-dur-base) var(--ds-ease),
                visibility var(--ds-dur-base) var(--ds-ease);
  }
  .main-nav.active,
  .main-nav.is-open { opacity: 1; visibility: visible; transform: translateY(0); }

  .nav-close { display: inline-flex; }
  .main-nav > ul { flex-direction: column; align-items: stretch; gap: var(--ds-space-1); }
  .nav-item { width: 100%; }
  .nav-item__row { justify-content: space-between; }
  .main-nav .nav-link { display: block; width: 100%; padding: 14px 12px; font-size: 1.125rem; color: var(--ds-surface-0); }
  .nav-item.is-active > .nav-item__row > .nav-link::after { left: 12px; right: auto; width: 32px; bottom: 6px; }
  .dropdown-toggle { width: 48px; height: 48px; }

  .dropdown-menu {
    position: static;
    display: none;
    min-width: 0;
    margin: 0 0 var(--ds-space-2);
    padding: var(--ds-space-2) 0 var(--ds-space-2) var(--ds-space-4);
    border: 0;
    border-left: 2px solid rgba(34, 211, 238, 0.4);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
  }
  .has-dropdown.is-open .dropdown-menu { display: block; }
  .has-dropdown.is-forced-closed .dropdown-menu { display: none !important; }
  .main-nav .dropdown-menu a { padding: 10px 12px; color: rgba(232, 240, 248, 0.78); }
  .main-nav .dropdown-menu a:hover { background: transparent; color: var(--ds-cyan-400); }

  .mobile-quote { display: block !important; margin-top: var(--ds-space-6); }
}

@media (max-width: 768px) {
  .section { padding: var(--ds-space-16) 0; }
  .page-hero { min-height: 300px; padding: var(--ds-space-12) 0; }
  .page-hero h1, .page-hero h2 { max-width: none; }
  .grid-2, .grid-3, .grid-4, .approach-grid, .industry-grid, .clients-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; text-align: left; }
  .footer-brand { grid-column: auto; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .footer-legal { flex-wrap: wrap; gap: var(--ds-space-4); }
  .contact-form .form-row { grid-template-columns: 1fr; }
  .breadcrumbs ol { padding-block: var(--ds-space-2); }
}

@media (max-width: 480px) {
  .container { padding-inline: var(--ds-space-4); }
  .hero-pause { right: var(--ds-space-4); bottom: 24px; }
  .section { padding: var(--ds-space-12) 0; }
  .page-hero { min-height: 260px; }
  .card { padding: var(--ds-space-6); }
  .client-card-image { height: 180px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .card:hover, .btn:hover { transform: none; }
}
