/* Global layout refinement v1.0. Loaded after individual modules.
   No resets of SVG, tariff grids, dialogs, colours or JS states. */
:root {
  --am-layout-max: 1400px;
  --am-layout-gutter: 20px;
  --am-type-h1: clamp(30px, 2.8vw, 48px);
  --am-type-h2: clamp(25px, 2.1vw, 36px);
  --am-type-h3: clamp(18px, 1.25vw, 20px);
  --am-type-body: 16px;
  --am-section-space: clamp(32px, 3.2vw, 56px);
}
@media (max-width: 767px) { :root { --am-layout-gutter: 16px; } }
/* Same outer width and content edges as the header. Preserve internal grids. */
.container { box-sizing: border-box; }
:is(.am-service-page,.am-development,.am-marketing,.am-seo,.am-serm,.am-direct,.am-leadgen) .container,
:is(.am-service-page,.am-development,.am-marketing,.am-seo,.am-serm,.am-direct,.am-leadgen) section > .container,
:is(.am-service-page,.am-development,.am-marketing,.am-seo,.am-serm,.am-direct,.am-leadgen) .am-home-consultation > .container {
  box-sizing: border-box;
  width: 100%; max-width: var(--am-layout-max);
  padding-inline: var(--am-layout-gutter); margin-inline: auto;
}
/* Regional H1 uses the available column, not a character-based cap. */
.am-service-page .am-sp-hero .am-sp-hero__title,
:is(.am-service-page,.am-development,.am-marketing,.am-seo,.am-serm,.am-direct,.am-leadgen) .mk-hero h1,
.am-development .dc-hero h1 {
  max-width: 100%; font-family: var(--font-headings, sans-serif);
  font-size: var(--am-type-h1); line-height: 1.16; font-weight: 800;
  letter-spacing: -.025em; text-transform: none;
  overflow-wrap: break-word; word-break: normal; hyphens: auto;
  text-wrap: initial;
}
.am-service-page .am-sp-hero .am-sp-hero__lead,
.am-service-page .am-sp-hero .am-sp-hero__text,
:is(.am-service-page,.am-development,.am-marketing,.am-seo,.am-serm,.am-direct,.am-leadgen) .mk-hero .mk-lead {
  max-width: 65ch; font-family: var(--font-main, sans-serif);
  font-size: var(--am-type-body); line-height: 1.6; font-weight: 400;
  overflow-wrap: break-word;
}
.am-service-page .am-sp-hero .am-sp-hero__grid {
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
  gap: clamp(24px, 3vw, 48px); align-items: center;
}
.am-service-page .am-sp-hero .am-sp-hero__visual { min-width: 0; order: 0; }
.am-service-page .am-sp-hero .sp-hero-image,
.am-service-page .am-sp-hero .sp-hero-fallback {
  display: block; width: min(100%, 440px); max-width: 100%; height: auto;
  max-height: 360px; object-fit: contain; margin: auto;
}
.am-service-page .am-sp-hero .sv-hero-art { max-width: 100%; height: auto; object-fit: contain; }
:is(.am-service-page,.am-development,.am-marketing,.am-seo,.am-serm,.am-direct,.am-leadgen) .mk-heading h2,
.am-development .dc-heading h2,
.am-service-page .section-title,
.am-service-page .service-section > .container > h2 {
  font-family: var(--font-headings, sans-serif); font-size: var(--am-type-h2);
  line-height: 1.22; letter-spacing: -.02em; text-transform: none;
  overflow-wrap: break-word; word-break: normal; hyphens: auto;
}
/* Narrow side headings use a smaller size without forcing character breaks. */
.am-development .dc-case-layout > .dc-heading h2,
.am-development .dc-soft > .container > .dc-heading h2,
.am-service-page .comparison-section .section-title {
  font-size: clamp(24px, 1.8vw, 32px); line-height: 1.25;
}
:is(.am-service-page,.am-development,.am-marketing,.am-seo,.am-serm,.am-direct,.am-leadgen) :is(.mk-service,.mk-stage,.mk-guide-card,.sv-card,.sp-price-card,.service-card,.process-card) h3,
.am-service-page :is(.service-card__title,.process-card__title,.sp-price-title) {
  font-size: var(--am-type-h3); line-height: 1.3; overflow-wrap: break-word;
  word-break: normal; hyphens: auto;
}
:is(.am-service-page,.am-development,.am-marketing,.am-seo,.am-serm,.am-direct,.am-leadgen) :is(.mk-service,.mk-stage,.sv-card,.sp-result-copy) p,
.am-service-page :is(.service-card__desc,.process-card__subtitle,.sp-price-description) {
  font-size: var(--am-type-body); line-height: 1.55; overflow-wrap: break-word;
}
.am-service-page .service-section, :is(.am-service-page,.am-development,.am-marketing,.am-seo,.am-serm,.am-direct,.am-leadgen) .mk-section { padding-block: var(--am-section-space); }
@media (max-width: 767px) {
  .am-service-page .am-sp-hero .am-sp-hero__grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .am-service-page .am-sp-hero .am-sp-hero__visual { min-height: 0; }
  .am-service-page .am-sp-hero .sp-hero-image,
  .am-service-page .am-sp-hero .sp-hero-fallback { max-height: 240px; }
  .am-service-page .am-sp-hero .am-sp-hero__visual:has(.am-sp-hero__device) { min-height: 220px; }
}

/* Keep the same gutters in header/footer and modern page containers. */
:is(.header,.topbar,.footer) .container { max-width: var(--am-layout-max); width: 100%; padding-inline: var(--am-layout-gutter); margin-inline: auto; }
